Presentation is loading. Please wait.

Presentation is loading. Please wait.

ArchStudio 4 An Introductory Tutorial

Similar presentations


Presentation on theme: "ArchStudio 4 An Introductory Tutorial"— Presentation transcript:

1 ArchStudio 4 An Introductory Tutorial
Slides adapted from Hazel Asuncion

2 Roadmap What is ArchStudio 4 Concepts Toolset integrated with Eclipse
xADL 2.0 Data Bindings Myx Architectural Style Toolset integrated with Eclipse Eclipse plug-in AIM Launcher ArchEdit Archipelago ArchLight Selector Type Wrangler Using ArchStudio Hello World Demo

3 What is ArchStudio 4? Architecture-centric IDE Open-source
Eclipse plug-in Integrated tools for software architecture Modeling Visualization Analysis Implementation Developed by mainly Eric Dashofy. Scott Hendrickson Ref:

4 Just Another IDE? No, it complements existing IDEs like Eclipse
Minimize architectural drift “Architectural drift: is the introduction of principal design decisions into a system’s descriptive architecture that are not included in, encompassed by, or implied by the prescriptive architecture, but which do not violate any of the prescriptive architecture’s design decisions… If not properly addressed, architectural drift will eventually result in architectural erosion.” [Taylor et al, 2009] Built on its own architecture style

5 Concepts xADL 2.0 Data Bindings Myx Architectural Style

6 xADL 2.0 Architectural Description Language in XML developed by ISR at UCI This ADL is defined in a set of XML Schemas Modeling language behind ArchStudio Modular and highly extensible Core models Components (computation) Connectors (communication) Interfaces (the exposed entry and exit points for components and connectors) Configurations (topology) One of the reasons why chose XML – plenty of third party tools that can manipulate an XML doc Modular – not monolithic architecture. Easy to extend Ref:

7 xADL 2.0 Tools can access the architecture description in xADL 2.0 via a common interface, the component xArchADT. Base: xArch Instances Core Extensions Architecture structures and types Product Families – versions, options, variants Implementation mappings – architecture types to implementations Component, connector instances Component Type, connector types Ref:

8 xADL 2.0: CM/Product Family Arch
Ref:

9 xADL 2.0: Implementation Mapping
ArchStudio 4 currently supports mapping to Java files Ref:

10 XML eXtensible Markup Language Means of representing structured data
Looks like HTML but the tags are user-defined Schema Describe data in the XML doc The “rules” for the XML doc Schema – run validator tools Ref:

11 xADL 2.0 Core Model Server HTTP Client
<archStructure id="archStructure90164" type="types:ArchStructure"> <description>main</description> <component id="componentffa805157" type="types:Component"> <description>Server</description> <interface id="interfaceffa80123" type="types:Interface"> <description>getResource</description> <direction>in</direction> </interface> </component> <component id="componentffa12852" type="types:Component"> <description>Client</description> <interface id="interfaceffa57518" type="types:Interface"> <direction>out</direction> <connector id="connectorffa12435" type="types:Connector"> <description>HTTP</description> <interface id="interfaceffa54685" type="types:Interface"> <interface id="interfaceffa54686" type="types:Interface"> </connector> </archStructure> Server HTTP Client

12 xADL 2.0 Components Server HTTP Client
<component id="componentffa805157" type="types:Component"> <description>Server</description> <interface id="interfaceffa80123" type="types:Interface"> <description>getResource</description> <direction>in</direction> </interface> </component> <component id="componentffa12852" type="types:Component"> <description>Client</description> <interface id="interfaceffa57518" type="types:Interface"> <direction>out</direction> HTTP Client

13 xADL 2.0 Connector Server HTTP Client
<connector id="connectorffa12435" type="types:Connector"> <description>HTTP</description> <interface id="interfaceffa54685" type="types:Interface"> <description>getResource</description> <direction>in</direction> </interface> <interface id="interfaceffa54686" type="types:Interface"> <direction>out</direction> </connector> HTTP Client

14 xADL 2.0 Interfaces Server HTTP Client
<component id="componentffa805157" type="types:Component"> <description>Server</description> <interface id="interfaceffa80123" type="types:Interface"> <description>getResource</description> <direction>in</direction> </interface> </component> <component id="componentffa12852" type="types:Component"> <description>Client</description> <interface id="interfaceffa57518" type="types:Interface"> <direction>out</direction> <connector id="connectorffa12435" type="types:Connector"> <description>HTTP</description> <interface id="interfaceffa54685" type="types:Interface"> <interface id="interfaceffa54686" type="types:Interface"> </connector> Server HTTP Note the direction of the interfaces specified by the direction tag Client

15 Data Bindings A set of Java classes that can be used to create and manipulate architecture descriptions Generated by “Apigen” tool, based on XML schemas Reduces the complexity of editing architecture descriptions by hiding the XML and providing constructs more familiar to architects Parses from and serializes to XML Data Binding API Components Connectors Interfaces Links Configurations etc. XML API (DOM, SAX) Elements Attributes Documents Namespaces vs. Ref:

16 Data Binding Library xArchADT – most used component in ArchStudio – event based interface. Data store for arch descriptions Ref: Dashofy, E., Asuncion, H., et al. ArchStudio 4: An Architecture-Based Meta-modeling Environment. ICSE 2007 Demo Paper.

17 Myx Architecture Style
Purpose Support building flexible, high performance tool-integrating environments Serve as a foundation for building environments in Eclipse Heritage Borrows most of key properties from C2 style System implementation currently supported in ArchStudio 4 Purpose An architectural style is a named collection of architectural design decisions that (1) are applicable in a given development context, (2) constrain architectural design decisions that are specific to a particular system within that context, and (3) elicit beneficial qualities in each resulting system. [Taylor et al, 2009] In this case we are geared toward supporting the building of applications like ArchStudio Ref:

18 Myx Architectural Style
Rules Components are the loci of computation Connectors are the loci of communication Components communicate only through well-defined provided and required interfaces Components and connectors have two ‘faces’: ‘top’ and ‘bottom’ Components interact through three distinct patterns Synchronous bottom-to-top procedure call Asynchronous top-to-bottom (notification) messaging Asynchronous bottom-to-top (request) messaging Components may only make assumptions about the services provided above them, and may make no assumptions about the services provided below them. Applications have at least one main thread of control. Additional threads may be created by components as necessary. Asynchronous connectors also have their own threads. Shared Memory Additionally, architects must decide whether or not to allow components to share memory and pass pointers. This significantly increases coupling and limits the ability of Myx architectures to be distributed across hosts. For these reasons, shared memory assumptions should not be made unless absolutely necessary—all parameters passed over a call or asynchronous invocation should be serializable. For some applications, it may be more useful to establish ‘regions of shared memory’ in which groups of components are allowed to pass pointers to one another, but not allowed to pass pointers across the regional boundary. This can be achieved from a modeling/implementation perspective using subarchitectures. Ref:

19 Myx Architectural Style
Benefits Easy to reuse - components are relatively independent of each other Easy to reconfigure – communication only via explicit interfaces Enables runtime modification – through dynamic proxies and event pumps Dynamic proxies and event pumps can be used to connect and disconnect components at run-time.

20 Myx.fw Framework Difficult to adhere to the constraints of a style using an existing programming language Bridge the gap between Myx and Java: myx.fw Component and Connectors implement IMyxBrick interface Ref:

21 Implementing a myx.fw component
Components have main classes that implement IMyxBrick They may have as many auxiliary classes as you want The main class may just be a wrapper for services provided internally AbstractMyxSimpleBrick IMyxBrick implements extends LunarLanderComponents Ref:

22 Implementing a myx.fw component
Components have three main jobs Store data from the framework (IMyxBrickItems) Implement lifecycle methods (init, begin, end, destroy) Provide true objects for all provided interfaces Ref:

23 Component Jobs Store IMyxBrickItems from the framework
The framework needs to store some data about the component along with the component Abstract base classes take care of this for you Implement lifecycle methods Called by the framework when the architecture is in particular states init(): Brick is created begin(): Brick is wired into the architecture and ready to start end(): Brick is about to be unwired and shut down destroy(): Brick is about to be dismissed Ref:

24 Component Jobs Provide true objects for each provided interface
Each provided/required interface has a name The framework will occasionally ask a component “give me the object that corresponds to this provided interface” Likewise, a component may request, from the framework, the true object corresponding to one of its required interfaces Later Ref:

25 Toolset Integrated with Eclipse
Eclipse plug-in ArchStudio Perspective AIM Launcher – launch the system in development within ArchStudio ArchEdit Visualization Tree-view – schema driven Indicate implementation mappings Archipelago Visualization and modeling Boxes and arrows ArchLight - analysis Selector – product Families Type Wrangler – consistency checks between types and instances

26 ArchStudio 4.0 Built on its own tools and technologies
Architecture specified in xADL 2.0 Upon invocation Bootstrapper parses the ArchStudio xADL file using the Data Binding Library Bootstrapper steps through xADL file and instantiates the various components Reference to the demo paper

27 ArchStudio Tools xArchADT – Data Store Live integration between tools
Reference Ref:

28 Using ArchStudio Hello World Demo

29 Hello World Demo 1. Create Architecture 2. Add component
1.1 Create Structure 1.2 Create Types Set and Component Type 2. Add component 2.1 Edit description 2.2 Assign type to component 3. Map Architecture to Implementation 4. Write HelloWorld Java class 5. Move xml file to Java Project 6. Run Hello World

30 1. Create Architecture In Eclipse, go to ArchStudio Perspective
Create a new project. File->New->Project. General->Project. Next. Project Name: HelloWorldProject. Finish

31 1. Create Architecture Right-click on the Project and select New->Other…ArchStudio 4 -> ArchStudio architecture Description File Name: Architecture.xml. Finish. Open the xml file with Archipelago.

32 1.1 Create Structure On the Outline View, expand the root element. Right click on Structures. Select New Structure. Expand Structures. Right click on the new Structure and select Edit Description. New Description: HelloWorld

33 1.2 Create Type Set and Component Type
On the Outline View, select the root element. Right click on it. Select Create Type Set. Expand Types. Right click on Component Types and select New Component Type. Select the new Type. Right click on it and select Edit Description. New Description: HelloWorldType

34 2. Add Component In the Outline View, double click on the HelloWorld structure Right click on the Archipelago View and Select New Component

35 2.1 Edit description Right click on the new component. Select Edit Description… New Description: HelloWorld

36 2.2 Assign type to component
Select HelloWorldType in the Outline View. Drag it and drop it on the HelloWorld component.

37 3. Map Architecture to Implementation
In the Navigator View, right click on the xml file. Open With->ArchEdit In the Outline View, Expand Xarch, Arch Types, Component Type [HelloWorldType]. Right click on it. Select Promote to VariantComponentTypeImpl

38 3. Map Architecture to Implementation
Similarly, right click on Component Type [HelloWorld Type]. Select Add Implementation. Right click on Implementation and select Promote to JavaImplementation Right click on Implementation and select Add Main Class

39 3. Map Architecture to Implementation
Right click on Main Class and select Add JavaClassName Expand MainClass and double click on Java ClassName and enter “HelloWorld” as a value

40 4. Write Java Class Create Java Project. File->New->Java Project. Project Name: HelloWorld. Next. Click on Projects, Add.. Check edu.uci.isr.myx.fw. OK and Finish.

41 4. Write Java Class Right click on HelloWorld project and select New-> Class Class Name: Hello World. Finish.

42 4. Write Java Class Copy the following content in HelloWorld.java and Save the file import edu.uci.isr.myx.fw.AbstractMyxSimpleBrick; import edu.uci.isr.myx.fw.IMyxName; import edu.uci.isr.myx.fw.MyxUtils; public class HelloWorld extends AbstractMyxSimpleBrick{ // category: constructor public HelloWorld( ){} // category: startup and cleanup public void init(){} public void begin() { System.out.println("Hello world!"); } public void end(){} public void destroy(){} // override a required method public Object getServiceObject(IMyxName name){ //Since we are not implementing an interface in this class //we will return null. //if(name.equals(INTERFACE_NAME_IN_NAME)){ // return this; //} return null;

43 5. Move XML file to Java Project
Create “arch” folder in HelloWorld/src Move (drag and drop)Architecture.xml from HelloWorldProject to HelloWorld/src/arch

44 6. Run Hello World In the Navigator View, right click on Architecture.xml, select Open With AIM Launcher In the Outline View, double click on HelloWorld Click on Instantiate

45 6. Run Hello World You should see the following output in the Console


Download ppt "ArchStudio 4 An Introductory Tutorial"

Similar presentations


Ads by Google