SDA SE Wiki

Software Engineering for Smart Data Analytics & Smart Data Analytics for Software Engineering

User Tools

Site Tools


Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
research:logicaj:tutorial [2009/06/05 14:18]
Günter Kniesel
research:logicaj:tutorial [2018/05/09 01:59] (current)
Line 1: Line 1:
 +===== Tutorial =====
 +
 +==== Installation ====
 +Follow the [[installation|installation instructions]] for LogicAJ and set up the [[available again on June 15, 2009 |LogicAJ Demo Project]]. ​
 +
 +/*
 +<​html>​
 +<br clear="​all"/><​div class="​mediaright borderimg"><​img src="/​_media/​research/​logicaj/​assignfactbase.png" ​ title="​Outline"​ alt="​Outline"/>​Assign JTransformer Factbase</​div>​
 +</​html>​
 +*/
 +
 +==== Getting Started ====
 +
 +{{  :​research:​logicaj:​assignfactbase.png|Assign a Factbase to your Java Project}} ​
 +To activate JTransformer for an existing Java project switch to the Java Perspective, ​ right-click ​ on the Java project in the context menu and select **Assign JTranformer Factbase**.\\
 +A Background job generating the fact representation should start immediately,​ as indicated by a progress bar in the lower right corner of the window. As usual you can open the Progress View (Window->​Show View->​Basic->​Progress),​ to get more detailed information.
 +Note that this initial fact generation may take a while on large projects, but it only happens once. From this point on, the fact representation will be updated on every change to the Java source, as long as there are no compilation problems.
 +
 +/* <​html>​
 +<br clear="​all"/><​div class="​mediaright borderimg"><​img src="/​_media/​research/​logicaj/​jticonandoutputproject.png"​ alt="​JTransformer Icon"/>​JTransformer Overlay Icon</​div>​
 +</​html>​
 +*/
 +{{  :​research:​logicaj:​jticonandoutputproject.png|}}
 +By assigning the jtransformer factbase a project with the name //<​project name>​-output//​ is created and your project is marked with a green JT in the upper left corner of the project icon. See screenshot on the right.
 +
 +<​html><​br clear="​all"/></​html>​
 +
 +==== Overview of the LogicAJ Eclipse Integration ====
 +Now the project is ready for use with LogicAJ aspects. Import the LogicAJ demo project into your workspace (File->​Import). Open an aspect from the directory aspects. The screenshot below shows the integration of the LogicAJ compiler into Eclipse. The LogicAJ editor provides highlighting and an outline for the aspect constructs. Errors in the LogicAJ aspects and the blame assignment of the declare error / warning statements are shown in the standard problems view:
 +
 +<​html>​
 +<br clear="​all"/><​img style="​border:​thin solid #​0000CC;"​ src="/​_media/​research/​logicaj/​logicaj_editor_overview.png"​ alt="​LogicAJ Editor"/>​
 +</​html>​
 +
 +==== Compile and Weave an Aspect ====
 +
 +Aspect compilation and weaving are two different steps in LogicAJ.
 +Compilation checks the syntactic correctness of the aspect and the type safety of aspect code that does not depend on logic-meta variables.
 +
 +The compilation is done automatically on every save of a file or if you press the c{{:​research:​logicaj:​logicaj.compile.gif|Compile Aspect}} button (see toolbar on the right). ​
 +
 +<​html>​
 +<br clear="​all"/><​div class="​mediaright borderimg"​ ><img src="/​_media/​research/​logicaj/​weave_aspect_action.png"​ alt="​Weave Aspect Action"/><​i>​Weave Aspect</​i>​ Context Menu Item</​div>​
 +</​html>​
 +
 +=== Select Aspects to Weave ===
 +To weave/​deactivate an aspect toggle the **Weave Aspect** item in navigator'​s context menu.
 +This item will add resp. remove the aspect from the /lajbuild file in the project'​s root folder.
 +It contains project relative paths to the selected aspects:
 +  aspects/​HashcodeEqualsAspect.aj
 +  aspects/​MockAspect.aj
 +  aspects/​AbstractVisitorAspect.aj
 +  aspects/​VisitorAspect.aj
 +
 +Here you may change the order of the aspects. The **order is important** if you refer to an introduces class member from another introduced element of advice.
 +The introducing aspect must come first in the lajbuild file in this case.
 +
 +<​html>​
 +<br clear="​all"/><​div class="​mediaright borderimg"​ ><img src="/​_media/​research/​logicaj/​logicaj_toolbar_icons.png"​ alt="​LogicAJ Toolbar"/>​LogicAJ Toolbar</​div>​
 +</​html>​
 +
 +=== Weaving ===
 +To weave the selected aspects press the {{:​research:​logicaj:​logicaj.weave.gif|Weave aspects}} button in the LogicAJ toolbar (see screenshot on the right). Make sure that the file currently open in the editor is contained in the project you want to weave. The button only weaves the aspects for the enclosing project.
 +
 +<​html>​
 +<br clear="​all"/><​div class="​mediaright borderimg"><​img src="/​_media/​research/​logicaj/​outline_mock_aspect.png" ​ title="​Outline"​ alt="​Outline"/>​LogicAJ Outline</​div>​
 +</​html>​
 +
 +=== Weaving Results ===
 +Weaving results will be shown in the outline. In the outline you can click on the rows below the aspect construct to show the join point shadow in the editor. It is underlined in the source code.
 +
 +Alternatively you may open the the weaving results view which shows an aggregation of all aspect outlines in on view: //​LogicAJ->​Show Weaving Results//
 +
 +
 +==== Starting a woven application ====
 +The LogicAJ compiler realizes aspect weaving as a source-to-source transformation.
 +The weaving step generates all (woven) classes into the corresponding **output project**.
 +
 +That's why you run your main classes (Html2Wiki in case of the LogicAJDemo project) only from the output project.
 +
 +
  
research/logicaj/tutorial.txt · Last modified: 2018/05/09 01:59 (external edit)

SEWiki, © 2019