MDA Architecture - UML modeling Presentation

12
Presented By: Anand C Date: 08/26/2008 1 CONTENTS Pages Introduction Magicdraw - 2 Why we need Magicdraw? - 2 MagicDraw and UML - 3 Working with Diagram - 3 Working with Project - 3 Conclusion - 4

description

Magicdraw UML modeling

Transcript of MDA Architecture - UML modeling Presentation

Page 1: MDA Architecture - UML modeling Presentation

Presented By: Anand C Date: 08/26/2008

1

CONTENTS Pages

Introduction Magicdraw - 2Why we need Magicdraw? - 2

MagicDraw and UML - 3

Working with Diagram - 3

Working with Project - 3

Conclusion - 4

Page 2: MDA Architecture - UML modeling Presentation

Presented By: Anand C Date: 08/26/2008

2

Magicdraw UML modeling

As my understanding MagicDraw is a visual UML modeling tool which is designed for developers. So they can deliver source code from their UML model instantly. This tool will allow the developer or business professional to draw, design, and view UML diagrams of Object Oriented systems. MagicDraw is a code engineering tool which has best code engineering mechanism - full round-trip support for Java, C++ and other programming languages, We may construct UML models, generate source code from it, code more by hand or use our favorite IDE, then reverse the code again, make some changes in MagicDraw, and merge that model with code again - no details are lost, no matter which way backward or forward we are going.

Why we need Magicdraw?

The key features of Magicdraw is “Fastest way to create Application Architecture”, other main features are,

(a) MagicDraw's reverse engineering is the fastest way to get UML models from Java and XML Schema source code. Automatic generation of sequence diagrams from Java source code adds a more detailed view of the system.

(b) Automatic generation of static structure.(c) Package dependency.(d) Automatically generating our hierarchy diagram allows multiple views

of the same model.(e) MagicDraw's Teamwork Server, multiple developers can work

simultaneously on the same model. This accelerates our team's collaboration while providing simple configuration management, controlled access to all our artifacts, and remote access to our model. It's the optimal way to manage our model and avoid version conflicts.

(f) Support most popular IDEs Eclipse, IBM WSAD and RAD, Borland JBuilder, IntelliJ IDEA, NetBeans, Sun Java Studio eliminate the need for a native MagicDraw IDE.

(g) Round-trip engineering to keep model and code synchronized.(h) Easy GUI access(i) Delivers source code from our UML model instantly(j) Automatic report generation(k) The report engine allows we to generate up-to-date reports based on our

own templates with lowest and formatting specified.(l) We can quickly create custom diagrams that fit our software development

process. Define our own custom toolbar for stereotyped element creation -- we'll instantly accelerate our modeling effort.

(m) MagicDraw UML allows model transformations both ways: from Platform Independent Model (PIM) to Platform Specific Model (PSM) and from

Page 3: MDA Architecture - UML modeling Presentation

Presented By: Anand C Date: 08/26/2008

3

PSM to PIM. With model transformations, we can produce many specific models, such as XML Schema, DDL, or our customized specific model from a generic one.

(n) Seedy navigation through our models(o) MagicDraw runs on a wide variety of operating systems, such as Windows

98/ME/NT/2000/XP/Vista, Solaris, OS/2, Linux, HP-UX, AIX, MacOS (X) and everywhere else where Java 5 or 6 is supported.

MagicDraw and UML

UML provides standardized pictures of our software applications and allows development team to quickly grasp the functionality contained within the application. UML is a language and a process with neutral notation. This means that we can use it to design our entire OO System in any programming language and any software development process.

Visual modeling means that first design our system by drawingdiagrams and then employ tools to convert those diagrams into code. The transition from the design to the implementation phase is smoother and more straightforward. Moreover, using the features of reverse engineering and code generation, the developer can move back and forth between the code and the design that is being expressed in theDiagrams.

Visual modeling tools provide many features that replace some of the more tedious tasks for the developer. Some of the leading tools provide so-called round-trip code engineering capabilities – the structure of reverse engineered code is changed in the modeling tool and is generated back without the implementation of specific information lost.

Working with DiagramWhen working with diagrams it is helpful to keep in mind the following concepts:

• A shape refers to a notation of a model element, such as a package, class, state, use case, object, or others.

• A path refers to the notation for the various kinds of relationships such as associations, aggregations, dependency, message, and links.

• Both paths and shapes are defined as symbols.

Diagram BasicsTo create a new diagram

From the toolbar:Click the desired diagram button on the toolbar. The Create Diagram dialog box opens. Enter the name of the diagram and select or create a package where we wish to create our diagram.

Page 4: MDA Architecture - UML modeling Presentation

Presented By: Anand C Date: 08/26/2008

4

From the Diagrams menu:From the Diagrams menu, select the desired diagram. The corresponding Diagrams dialog box opens. Click Add. The Create Diagram dialog box opens. Enter the name of the diagram and select or create a package where we wish to create our diagram.

From the Browser:Right-click the desired model element in which we would like to create a diagram and, from the shortcut menu, select New Diagram. Type the name for diagram directly in the Browser.

From the model element Specification dialog box:Open the Package, Profile, Model Specification or other elements Inner Elements tab. Click Create. The corresponding Diagram Specification dialog box opens. In this dialog box, we can define the diagram

From the Browser:Select Open from the diagram item shortcut menu or double-click the diagram item.

From the Diagrams menu:From the Diagrams menu, select the desired diagram. The corresponding Diagrams dialog box opens. Click the Open button.

From the Content Diagram (available only in the Enterprise edition),If a diagram is added to the table of contents or a symbol of a diagram is drawn on the Diagram Pane.If the diagram is assigned to a particular model element, double click this model element.

Working with Projects

The newly created project consists of the following packages:

1. Data package is empty and holds all model elements

2. File View package contains components that are created during code engineering and Represent source files. Adding a resident element to a particular component causes that Element to be generated within the source file.

3. UML Standard Profile contains stereotypes that are necessary for working with MagicDraw, primitive data types and constraints (which are UML standard), and UML 2 metamodel elements. The following data types are specified in MagicDraw: boolean, byte, char, date, double, float, int, Integer, long, short, void, and string. We can also create our own packages for holding the model elements. By default, packages cannot be deleted or renamed in a project (except for the File View package).

Conclusion

MagicDraw is a serious contender among UML design tools. While providing extensive UML 2.0 support.

Page 5: MDA Architecture - UML modeling Presentation

Presented By: Anand C Date: 08/26/2008

5

AndroMDAA New Paradigm in software development

CONTENTS Pages

Introduction AndroMDA - 6

Why AndroMDA? - 6

MDA and code generation - 6

AndroMDA Features 7

Working with AndroMDA 7

How AndroMDA generates code 7

Conclusion 7

Page 6: MDA Architecture - UML modeling Presentation

Presented By: Anand C Date: 08/26/2008

6

AndroMDA - Code Generation

Introduction

AndroMDA is one of the most poourful Open Source MDA Generators. It is used all over the world for everything from simple applications to complex enterprise applications. AndroMDA comes with an array of ready-made cartridges for common architectures like Spring, EJB, .NET, Hibernate and Struts.

Why AndroMDA?AndroMDA can setup a new J2EE project from scratch, in which code is

generated from a UML model. We can choose to generate code for Hibernate, EJB, Spring, Web Services, and Struts. The generated code is automatically integrated into the build process.

1. No need to write redundant code. 2. Our project models will reflect our code. 3. Projects are diagrammed in a standard platform independent way making it much

faster to adapt to ever rapidly changing technologies. 4. We will have our models that allow much easier communication with the business

logic.

MDA and code generation

MDA is a set of related standards specified by the Object Management Group (OMG). MDA generators which use some or all of these standards to turn UML models into working Java. Ideally MDA generators build full applications, constructed from a set of components, from one or more input models.

MDA is the idea of multiple levels of models. This starts at the highest level with the platform independent model (PIM). The PIM specifies and maps entities in the most abstract form possible which still captures all of the requirements. The next level down is the platform specific model (PSM). This model is an augmented version of the PIM which adds all of the structures required to implement the PIM, but still modeled in a UML form. Generators use the PSM to create the output code.

AndroMDA Main Features

Page 7: MDA Architecture - UML modeling Presentation

Presented By: Anand C Date: 08/26/2008

7

1. AndroMDA is pluggable and can be exchanged.

2. AndroMDA will support for major UML tools like MagicDraw

3. Model transformations help to raise abstraction level. We can write our own transformations in any transformation language.

4. Templates are based on well-known template engines. Right now, Velocity and FreeMarker are supported

5. Cartridges for common enterprise architectures (EJB, Spring, Hibernate, Struts, JSF, Axis, jBPM)

Working with AndroMDA

AndroMDA is an automatic tool. AndroMDA preconditions are modeling conventions. This means that a UML model for use with AndroMDA cannot be structured arbitrarily but has to certain structure that can be interpreted by AndroMDA.

Modeling standards/requirements will ultimately be dependantant on the implementation of the cartridge. Each cartridge has required properties and modeling conventions that must be followed. In general, there are rules to follow when we start design model and we want AndroMDA to generate our components smoothly.

How AndroMDA generates code?

The following describes the process of AndroMDA engine to generate code.

1. Cartridges that the project requires are loaded by the engine.2. The engine will parses the UML model's XMI file, creating an object tree of the

model for use by the engine and the cartridge templates.3. Then engine will traverses the object tree, looking for classes tagged with

stereotypes it recognizes4. For each class located, the appropriate cartridge template are identified and

dispatched to generate code. Multiple source code files may be generated for each tagged class in the model: more than one template in a given cartridge may generate code for any given class; more than one cartridge may generate code for any given class. The default templates for a cartridge may be used, or a customized version may be used, depending on our configuration.

5. The same process will repeated for every class in the model.

Conclusion

MODEL – Do not Code!!!

Page 8: MDA Architecture - UML modeling Presentation

Presented By: Anand C Date: 08/26/2008

8

Ajax

CONTENTS Pages

Introduction …………………………………………………9

Ajax Framework…………………………………………….9

Advantages of Ajax…………………………………………9

Frameworks and languages 10

Server-driven Ajax frameworks 10

JavaScript 10

Java 10

Ajax roundtrip 11Dispatching an XMLHttpRequest 11

Servlet request handling 11

Conclusion 12

Page 9: MDA Architecture - UML modeling Presentation

Presented By: Anand C Date: 08/26/2008

9

Ajax Framework

Introduction

AJAX is a framework for quickly creating efficient and interactive Web applications that work across all popular browsers. With Ajax, web applications can retrieve data from the server asynchronously. Data is retrieved using the HMLHttpRequest object or through the use of Remote Scripting in browsers that do not support it.

Ajax FrameworkIt’s a framework that helps to develop web applications using Ajax. Data

is read from the server by JavaScript requests. However, some processing at the server side may be required to handle requests, such as finding and storing the data. This is accomplished more easily with the use of a framework dedicated to process Ajax requests.

Advantages of Ajax

* Using Ajax, a web application can request only the content that needs to be updated, which drastically reducing bandwidth usage.

* Asynchronous requests allows the client's Web browser UI to be more interactive and to respond quickly to inputs, and sections of pages can also be reloaded individually. Users may perceive the application to be faster or more responsive, even if the application has not changed on the server side.

*The use of Ajax can reduce connections to the server, since scripts and style sheets only have to be requested once.

Page 10: MDA Architecture - UML modeling Presentation

Presented By: Anand C Date: 08/26/2008

10

Frameworks and languages

Server-driven Ajax frameworks

Components are created and manipulated on the server using a server-side programming language. Pages are then rendered by a combination of server-side and client-side HTML generation and manipulation. User actions are communicated to the server via Ajax techniques, server-side code manipulates a server-side component model, and changes to the server component model are reflected on the client automatically.

Ajax frameworks that handle presentation completely within the browser offer greater responsiveness because they handle many more user interactions without server involvement. For example an input field that is dynamically enabled or disabled based on server-side code may cause many network requests. Furthermore, server-dependent Ajax frameworks will never be able to offer support. Still, this approach is popular, especially in situations where the benefits of a full Ajax architecture can't be captured anyway.

JavaScript

JavaScript utilities run browser-side and are very commonly used in Ajax development. Prototype is a JavaScript extension that provides utilities to compensate for the shortcomings of JavaScript.

Java

Some Frameworks use Java for server-side AJAX operations. The Google Web Toolkit, a widget library with Java to JavaScript compiler, is widely used by webmasters.

Ajax roundtrip

Ajax interaction begins with a JavaScript object called XMLHttpRequest. As the name suggests, it allows a client-side script to perform HTTP requests, and it will parse an XML server response. The first step in this Ajax roundtrip is to create an XMLHttpRequest instance. The HTTP method to use for the request (GET or POST) and the destination URL are then set on the XMLHttpRequest object.

When we send that HTTP request, we don't want the browser to hang around waiting for the server to respond. Instead, we want it to continue reacting to the user's interaction with the page and deal with the server's response when it eventually arrives. To accomplish this, we can register a callback function with the XMLHttpRequest and then dispatch the XMLHttpRequest asynchronously. Control then returns to the browser, but the callback function will be called when the server's response arrives.

Page 11: MDA Architecture - UML modeling Presentation

Presented By: Anand C Date: 08/26/2008

11

On the Java Web server, the request arrives just like any other HttpServletRequest. After parsing the request parameters, the servlet invokes the necessary application logic, serializes its response into XML, and writes it to the HttpServletResponse.

Back on the client side, the callback function registered on the XMLHttpRequestis now invoked to process the XML document returned by the server. Finally, the user interface is updated in response to the data from the server;

Dispatching an XMLHttpRequest

Creating and dispatching an XMLHttpRequest from the browser. The method to create an XMLHttpRequest differs from browser to browser. The JavaScript function in Listing 2 smoothes out these browser-dependent wrinkles, detecting the correct approach for the current browser and returning an XMLHttpRequest ready to use. It's best to think of this as boilerplate code: simply copy it into our JavaScript library and use it when we need an XMLHttpRequest.

Servlet request handling

Handling an XMLHttpRequest with a servlet is largely the same as handling a regular HTTP request from a browser. The form-encoded data sent in the POST request's body can be obtained with HttpServletRequest.getParameter() calls. Ajax requests take part in the same HttpSession as regular Web requests from the application

It's important to set the response's content type to application/xml, otherwise the XMLHttpRequest will not parse the response content into an XML DOM

Response handling with JavaScript

The readyState property of XMLHttpRequest is a numeric value that gives the status of the request's lifecycle. It changes from 0 for "uninitialized" through to 4 for "complete." Each time the readyState changes, the readystatechange event fires and the handler function attached via the onreadystatechange property is called.

The function getReadyStateHandler() was called to create a handler function. This handler function was then assigned to the onreadystatechange property. getReadyStateHandler() exploits the fact that functions are first-class objects in JavaScript. This means that functions can be parameters to other functions and can also create and return other functions. It is the job of getReadyStateHandler() to return a function that checks whether the XMLHttpRequest has completed and passes the XML response onto the handler function specified by the caller. Listing 6 is the code for getReadyStateHandler()

Page 12: MDA Architecture - UML modeling Presentation

Presented By: Anand C Date: 08/26/2008

12

Conclusion

Ajax minimizes the number of page. The Ajax application stays on the screen continuously while the Ajax engine handles data exchange with the server. Instead of page refreshes, the application updates only those parts of the screen affected by newly arrived data.

--------------------------------------------------------------------------------------------------------