1.1 Purpose of this document

advertisement

ProCom@MDH

Design Description

Version: 2.0

Date: 2010-01-09

PROCOM@MDH

Design Description

Version 2.0

Page 1

ProCom@MDH

Design Description

Date

2009-10-08

2009-10-09

2009-12-14

2010-01-09

2010-01-10

Version: 2.0

Date: 2010-01-09

Revision History

Version

0.1

1.0

1.1

1.5

2.0

Description

Initial Draft MA, IA

Changes to prepare the document for submitting

PG

Finalized for release candidate BB

Final Doc BB

Author

Final Doc with updated Sequence and

Activity Diagram

PG

Page 2

ProCom@MDH

Design Description

Table of Contents

1. Introduction

1.1

Purpose of this document

1.2

Intended Audience

1.3

Scope

1.4

Definitions and acronyms

1.4.1

Definitions

1.4.2

Acronyms and abbreviations

1.5

References

2.

External interfaces

2.1

Graphical User Interface

3.

Software architecture

3.1

Software Architecture

3.2

Design Pattern

3.3

System specification

3.4

Error handling

4.

Detailed software design

4.1

Code Generation

4.2

Class Diagram

4.3

Activity Diagram

4.3.1

Generate code

4.3.2

Compile Code

4.3.3

View Code

4.4

Sequence Diagram

4.4.1

Generate Code

4.4.2

View Code

4.4.3

Compile Code

4.4.4

Clean Code

4.4.5

Generate DLL

4.4.6

Execute Code

4.5

Data Flow Diagram

5.

Approvals

Version: 2.0

Date: 2010-01-09

5

5

10

10

10

12

12

4

4

4

4

4

4

4

4

12

18

19

19

20

20

21

15

16

18

18

12

13

14

14

21

Page 3

1. Introduction

1.1 Purpose of this document

The purpose of this document is to define high-level conceptual design of ProCom plug-in. This document gives the software development team an overall guidance of the architecture of the

ProCom plug-in and is intended to satisfy all the customer requirements, objectives and expectations.

1.2

1.3

Intended Audience

This document gives an overview to the audience about the design specification of ProCom plugin, what exactly is expected out of the project. The intended audience includes:

• Customer

• Project group

• Steering group

Scope

This document contains working and concept implementation for our system. The design specifications provided in this document are based on a preliminary system analysis, and are not final.

Definitions and acronyms 1.4

1.4.1 Definitions

Keyword

ProgressIDE

PROGRESS

Executable Code

ProCom plug-in

ProCom@MDH

Definitions

The IDE which enables user to model the embedded system using the

ProCom Component model.

Research project at MDH

A Java (preferred) or C code for ProCom model

ProCom model-driven code generation

ProCom model-driven code generation

1.4.2 Acronyms and abbreviations

Acronym or

Abbreviation

ProCom model

MDH

XML

Definitions

The Progress Component Model

Mälardalen University

Extensible Markup Language, language for storing information

1.5 References

There are some study material provided for studying PROCOM model as

Formal semantics of ProCom (section 2 and 3).

PRCOM@MDH requirement document

PROCOM@MDH description document.

ProCom - the progress component model reference manual

ProgressIDE Manual

 http://en.wikipedia.org/wiki/Component-based_software_engineering

 http://java.sun.com/developer/technicalArticles/J2EE/despat/

2. External interfaces

This project GUI for PROCOM@MDH provides code generation functionality in the

PROGRESS-IDE to create the model for the embedded systems and then generate the code for their implementation. It provides graphical interface for the user to generate code for the ProCom components modeled in PROGRESS-IDE.

2.1 Graphical User Interface

PROGRESS - IDE editor contains project explorer where you can observe the tree of PROCOM components used for your model, attribute editor displays the attribute information, and the graphical editor where you design your PROCOM model.

The user is provided with option of ''GENERATE CODE” in the project explorer for the particular

PROCOM component for which user want to generate the code. This has been shown as

Figure 1: User Interface CodeCompilationOption

Figure 2:User Interface CodeGenerationWindow

Figure 3: User Interface CompileCodeOption

Figure 4:User Interface Toolbar Option

Figure 5: User Interface Folder Option

Figure 6: User Interface Menu Option

Figure 7: User Interface Class Files

Figure 8: User Interface Code Files

3. Software architecture

ProCom model is part of PROGRESS project, developed at Mälardalen University, which is used for formal modeling of embedded systems. ProCom@MDH enables user to generate executable code for the proCom models created in ProgressIDE. To generate executable code, a mapping of proCom models should be defined and a ProgressIDE plug-in for transforming models to code should be created.

3.1 Software Architecture

The architecture used in the project is client server in which the server is the progress IDE which provide the user interface for the user to create model and error free XML file as the input to the code generator plug-in.

This plug-in then read the XML file and generates the code in the language i.e. JAVA for the user to execute .This code is then saved to the user disk or send to the PROGRESS IDE for viewing depend on user options.

PROGRESS

IDE

(SERVER)

XML file

Sets of Code files

Code

Generator

Plug-in

(CLIENT)

3.2 Design Pattern

The whole system is divided into 3 main parts (MVC architecture):

User interface which is acts as view of the system which allow user to communicate with the system and perform the certain function such as code generation, code viewing. code compilation etc of the PROGRESS IDE

Model Part that specifies the internal data models used for storing the mapping data and this mapping data is used by the various business classes to generate the code for the PROCOM model.

Controller part which control flow of instruction for the code

Eclipse IDE

PROGRESS IDE

XML FILE

Executable Java Code

Generate

Code

Compile

Code

View

Code

The conceptual design of our system can be seen in the above diagram. After creating ProCom project user develops a model of the system using ProgressIDE. User selects “Generate code” option for the particular proCom component. Then PROGRESS IDE creates the XML file for the

PROCOM model This XML file will be used as input for code generation plug-in. Before code generation, user selects option whether standalone components are required or glue code. System saves the generated code for the model in place selected by the user. User can view as well as compile the generated code.

3.3 System specification

Various technologies and tools are going to be used on this project:

JAVA: o

J2SE 1.6 o

JAXP (JAVA API for XML processing)

ECLIPSE o

Eclipse Rich Client Platform

XML o

XML 2.0

TOOLS: o

PROGRESS IDE o

Eclipse Ganymede o MinGW GCC o Ant

All the tools and technologies used are open source and easily available.

3.4 Error handling

Error Action

Code generation failure Error will be reported to the user in form of a message box.

Code complication Error will be reported to the user in form of a message box. It shows the failure description of the problem.

Code viewing failure Error will be reported to the user using a message box.

XML file reading failure Error will be reported to the user in form of a dialog box.

Generated Code save Error will be reported to the user in form of a dialog box. failure

Dll generation error Error will be reported to the user in form of a dialog box.

Code clean malfunction Error will be reported to the user in form of a dialog box.

4. Detailed software design

ProCom Code generator is a plug-in for the eclipse IDE to generate executable Java code templates for the modeled components. Solution will always depend on the correctness of the output generated by the Progress-IDE.

4.1 Code Generation

ProCom Model Transformation: All the elements in the ProgressIDE are used to design the

ProCom model for an embedded system. The transformation of all the individual elements to their corresponding source code is the most essential part of the system. The generated code should be checked for its syntactic correctness through code compilation. Any error in compilation should be notified to the user as “Failure of Code Generation” action.

Glue Code Generation: Once the code mapping of all the ProCom elements is achieved, glue code should be generated for the system. Glue Code defines interaction between different components of a system. The code files generated after the glue code generation should be compiled to check for their syntactic correctness. Any error in compilation should be notified to the user as “Failure of Glue Code Generation” action.

Plug-in Development: The functionality of the model transformation and the glue code generation should be provided either in a new user interface or in the existing ProgressIDE

interface. The user interface and the functionality developed for code generation should be packaged in a plug-in for the ProgressIDE. The compatibility of the plug-in with the ProgressIDE should be checked.

4.2 Class Diagram

This class diagram shows the static structure of the MVC pattern used in the project.

Figure 9:Class Diagram for the project

4.3 Activity Diagram

There are various activity diagram shown for the activity which are performed for accomplish the function in the project.

4.3.1 Generate code

The following activity diagram shows the flow of actions in the system's workflow to generate the code from ProCom model.

Create ProCom Project

Select Model Develop Model By ProgressIDE

Select

Generate Code

Option

Browse Location for Code

Standalone Component or Glue Code

Generate Code

Error

Save Generated Code

Figure 9:Activity diagram for generate code

4.3.2 Compile Code

There should exist a valid ProCom model in the Progress IDE, for which code is generated. Once the code is generated, user can view & compile code. The following diagram shows the action flow to compile the generated code.

Generated Code

Select Compilation Option

Compile code

Error

Code Compilation

Defer it

Figure 10: Activity Diagram for compile code

4.3.3 Execute Code

User can execute the generated code from the ProCom model.

Figure 3:Activity Diagram for Execute Code

4.3.4 View Code

Finally the parallel activity to compile code, user can view the generated code from ProCom model .

Select Model

Error

Select File to View Code

Generated Code

Figure 11: Activity diagram for view code

4.4 Sequence Diagram

4.4.1 Generate Code

This sequence diagram shows the steps involves in generating the code from the ProCom model in the

PROGRESS-IDE

Figure 12: Sequence diagram for generate code

4.4.2 View Code

This sequence diagram shows the steps involves in viewing the generated code from the ProCom model in the PROGRESS-IDE

Figure 13: Sequence Diagram for view code

4.4.3 Compile Code

This sequence diagram shows the steps involves in compiling the generated code from the ProCom model in the PROGRESS-IDE

Figure 14: Sequence diagram for view code

4.4.4 Clean Code

This sequence diagram shows the steps involves in cleaning the compiled version of the generated code from the ProCom model in the PROGRESS-IDE

Figure 15: Sequence Diagram of Clean Code

4.4.5 Generate DLL

This sequence diagram shows the steps involves in generating DLL files of the generated code from the

ProCom model in the PROGRESS-IDE,which is need for the native function call as

Figure 16: Sequence Diagram of Generate DLL Action

4.4.6 Execute Code

This sequence diagram shows the steps involves executing the generated code from the ProCom model in the PROGRESS-IDE

Figure 17: Sequence Diagram of Execute Code

4.5 Data Flow Diagram

This diagram shows the flow of data between the progress IDE and code generator plug-in. Progress IDE provides the XML file to read and then code generator process generate the code and stores it in the disk space.

Progress IDE

XML

File

Code

Generation

Code files

C Disk Space

5. Approvals

Name

Title

Date yyyy-mm-dd

Signature

Download