Generation and Implementation. More on classes Types Implementation classes Interfaces Templates Associations –Dependencies –Compositions.

Slides:



Advertisements
Similar presentations
1 CIS224 Software Projects: Software Engineering and Research Methods Lecture 9 Object, Package, Component and Deployment Diagrams (Based on Fowler, 2004,
Advertisements

Using Eclipse. Getting Started There are three ways to create a Java project: 1:Select File > New > Project, 2 Select the arrow of the button in the upper.
UIC Data Conversion and Submission via CDX Node Client UIC Database V2 6/16/
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 8 Slide 1 System modeling 2.
® IBM Software Group © 2006 IBM Corporation Rational Software France Object-Oriented Analysis and Design with UML2 and Rational Software Modeler 04. Other.
Practical Object-Oriented Design with UML 2e Slide 1/1 ©The McGraw-Hill Companies, 2004 PRACTICAL OBJECT-ORIENTED DESIGN WITH UML 2e Chapter 5: Restaurant.
1 SWE Introduction to Software Engineering Lecture 23 – Architectural Design (Chapter 13)
7M701 1 Class Diagram advanced concepts. 7M701 2 Characteristics of Object Oriented Design (OOD) objectData and operations (functions) are combined 
Satzinger, Jackson, and Burd Object-Orieneted Analysis & Design
©Ian Sommerville 2006Software Engineering, 7th edition. Chapter 14 Slide 1 Object-oriented Design.
Lecture a: Additional UML Models: Package, Activity, Deployment Lecture b: Generalization, Aggregation and Additional Domain Model Notation Copyright W.
Objectives Explain the purpose and objectives of object- oriented design Develop design class diagrams Develop interaction diagrams based on the principles.
Rational Rose Tutorial
Modelling classes Drawing a Class Diagram. Class diagram First pick the classes –Choose relevant nouns, which have attributes and operations. Find the.
Using ERWin to model your data Supplied by Computer Associates as part of AllFusion.
Code Generation Why and how. Why generate code Manufacturer’s claims –Higher productivity in terms of quantity and conformity of code –Higher flexibility.
1 An Introduction to Visual Basic Objectives Explain the history of programming languages Define the terminology used in object-oriented programming.
Object-Oriented Analysis and Design
Objects What are Objects Observations
The Design Discipline.
CHAPTER 9 DATABASE MANAGEMENT © Prepared By: Razif Razali.
Software Construction Lecture 5 Class Diagrams. Agenda 2  Topics:  Examples of class diagrams  Navigation, visibility, named associations, and multiplicity.
® IBM Software Group © 2009 IBM Corporation Rational Publishing Engine RQM Multi Level Report Tutorial David Rennie, IBM Rational Services A/NZ
Copyright  Oracle Corporation, All rights reserved. 5 CMIS Powell Oracle Designer: Design Editor and Building the Database and Table API CMIS.
Prepared by: Sanaz Helmi Hoda Akbari Zahra Ahmadi Sharif University of Tech. Summer 2006 An Introduction to.
UML Diagrams: Class Diagrams The Static Analysis Model Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU.
In the next step you will enter some data records into the table. This can be done easily using the ‘Data Browser’. The data browser can be accessed via.
CSC 395 – Software Engineering Lecture 13: Object-Oriented Analysis –or– Let the Pain Begin (At Least I’m Honest!)
Lab 04.
Oracle Data Integrator Procedures, Advanced Workflows.
 Whether using paper forms or forms on the web, forms are used for gathering information. User enter information into designated areas, or fields. Forms.
Systems Analysis and Design in a Changing World, 3rd Edition
CS3773 Software Engineering Lecture 04 UML Class Diagram.
Object and Class Diagrams CSE301 University of Sunderland.
Introduction to Rational Rose 2000 v6.5 Copyright © 1999 Rational Software, all rights reserved 1 Rational Rose 2000 Class Diagrams.
Unified Modeling Language © 2002 by Dietrich and Urban1 ADVANCED DATABASE CONCEPTS Unified Modeling Language Susan D. Urban and Suzanne W. Dietrich Department.
Chapter 16 Applying UML and Patterns Craig Larman
The Static Analysis Model Class Diagrams Prof. Hany H. Ammar, CSEE, WVU, and Dept. of Computer Science, Faculty of Computers and Information, Cairo University.
UML Diagrams: The Static Model Class Diagrams. The Static Model Define the static structure of the logical model Represent classes, class hierarchies.
Sequence Diagrams And Collaboration Diagrams HungNM.
Class Diagram. Classes Software Design (UML) Class Name attributes operations A class is a description of a set of objects that share the same attributes,
1 Building FORMS In When a visitor enters information into a web form displayed in a web browser and clicks the submit button, the information is sent.
Design Model Lecture p6 T120B pavasario sem.
COMPONENT DIAGRAM in UML 2.0 Veronica Carrega. PLAN OF TALK  Introduction about components  Components and component diagrams in uml 2.0  Case study.
Introduction to KE EMu Unit objectives: Introduction to Windows Use the keyboard and mouse Use the desktop Open, move and resize a.
Chapter 16 UML Class Diagrams 1CS6359 Fall 2012 John Cole.
INFO 620Lecture #71 Information Systems Analysis and Design Design Class Diagrams and others INFO 620 Glenn Booker.
Identifying classes, Packages and drawing class Diagrams, Object Diagrams and composite structure diagrams Week 07 1.
Object Modeling THETOPPERSWAY.COM. Object Modelling Technique(OMT)  Building a model of an application domain and then adding implementation.
Slides prepared by Rose Williams, Binghamton University Chapter 16 Collections and Iterators.
Fusion Design Overview Object Interaction Graph Visibility Graph Class Descriptions Inheritance Graphs Fusion: Design The overall goal of Design is to.
M1G Introduction to Programming 2 2. Creating Classes: Game and Player.
Practical Object-Oriented Design with UML 2e Slide 1/1 ©The McGraw-Hill Companies, 2004 PRACTICAL OBJECT-ORIENTED DESIGN WITH UML 2e Chapter 6: Restaurant.
UML Fundamental Elements. Structural Elements Represent abstractions in our system. Elements that encapsulate the system's set of behaviors. Structural.
Class Diagrams Revisited. Parameterized Classes Parameterized Classes - are used to represent relationships between templates.
Introduction to UML and Rational Rose UML - Unified Modeling Language Rational Rose 98 - a GUI tool to systematically develop software through the following.
Copyright © 2007 by Pearson Education 1 UNIT 6A COMBINATIONAL CIRCUIT DESIGN WITH VHDL by Gregory L. Moss Click hyperlink below to select: Tutorial for.
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
1 Pertemuan 10 Using Type Matakuliah: U0344 / DESKTOP 1 Tahun: 2006.
Chapter 2: The Visual Studio .NET Development Environment
UML Diagrams: Class Diagrams The Static Analysis Model
UML Diagrams By Daniel Damaris Novarianto S..
COMPONENT & DEPLOYMENT DIAGRAMS
UML Diagrams Jung Woo.
UML Diagrams: The Static Model Class Diagrams
Object Oriented Analysis and Design
CIS 375 Bruce R. Maxim UM-Dearborn
Analysis models and design models
CIS 375 Bruce R. Maxim UM-Dearborn
Object Oriented System Design Class Diagrams
Presentation transcript:

Generation and Implementation

More on classes Types Implementation classes Interfaces Templates Associations –Dependencies –Compositions

Type classes –are classes that are defined as a collection of operations without methods. –They are used to model a collection of operations applicable to different classes of objects. –are denoted as stereotyped class rectangles. –are equivalent to abstract classes with no method and only abstract operations. –Must be stereotyped using the > keyword. –Are implemented by implementation classes. –May have generalisation relationships to other types.

‘AppleScript’ type classes AppleScript is a scripting system that allows you to directly control Macintosh applications It provides Unit Type value classes for working with measurements of length, area, cubic and liquid volume, mass, and temperature.

Unit Type value classes LengthAreaCubic volume Liquid volume WeightTemp- erature Centi- metres Square feet Cubic feetGallonsGramsDegrees Celcius KilometresSquare kilometres Cubic yards LitresKilogramsDegrees Fahrenheit FeetSquare Metres Cubic metres QuartsOuncesDegrees Kelvin InchesSquare miles Cubic metres Pounds Metres Miles

Implementation classes –are denoted as stereotyped class rectangles. –Must be stereotyped using the > keyword. –May implement other classes via a ‘realises’ generalisation relationship from the implementation class to the implemented class. The implementation class inherits operations but not structure (attributes / associations) –May also have generalisation relationships to other implementation classes.

Implementation classes These classes often do not relate to classes in the real-world domain. They are the ‘scaffolding’ classes that support the domain (boundary, control and entity) classes. An example would be a collection object to organise and maintain references to all objects in a collection. –This would be necessary to compile lists for scroll boxes, aggregate derived fields, etc.

Interfaces

These are classes that define a set of externally accessible operations without methods. They are used to model a collection of operations defining a service that may be offered by different classes. –Something like an external view in a database. Denoted as stereotyped class rectangles, or a small circles with the name of the interface attached.

interfaces Are equivalent to abstract classes with no attributes and no methods and only abstract public operations. –Must be stereotyped using the > keyword. –Must not have an attribute compartment. –Must not have associations. –Must have an operation compartment containing the interface’s operations.

interface The text editor uses a platform-independent interface, window. The window is an abstract class, defining the functionality required of the window, but not providing it. The specialised classes are concrete implementation classes. These provide the functionality for window Java uses the word ‘implements’ to show this. May be used by other classes via a dependency stereotyped using the > keyword.

Another depiction…

May have generalisation relationships with other interfaces. May be supported by other classes via a ‘realises’ generalisation relationship from the supporting class to the interface class. –The supporting class must offer all the operations defined in the interface class, and may offer new operations.

Templates

Templates / Parameterised classes These define a family of classes having a common form. The differences between classes in the family are represented by parameters, allowing a single template to instantiate many classes. Specific classes within this family are defined by specifying actual values that are bound to formal parameters. In the template, the parameters are unbound or unspecified. Also known as a parameterised class.

Templates / Parameterised class We want a class to list students and we want a class to list games. This could be done using two separate classes called StudentList and GameList, but they would have a lot in common. –Add element to the list. –Delete element from the list However, define List (T), which, given a class C to substitute for the formal parameter T, describes the class of lists of C objects. –an object of class List represents a list of students, –whereas an object of class List represents a list of games.

Example A template class is shown as a class with a small dashed rectangle in the top right hand corner, which holds the formal parameters.

Dependency Is denoted by a dashed arrow with the arrowhead pointing at the independent element. Relates elements of a model. Don’t require instances to associate; they exist among the model elements. Have elements that exist at the same level of abstraction or at the same level of detail.

May be stereotyped using the > keyword to depict different semantic levels of abstraction. The refinement may be described in a note attached to the dependency. May serve as a container for a group of dependencies from parts of a client element to parts of a supplier element.

Dependency An association relationship is a dependency relationship when the object requesting (client object) the service of another object (server object) does not have intrinsic knowledge of the location of the server object - it must be told where the object is located. –Typically, either the server object is passed as a parameter to one of the methods of the client class or the server class is declared locally within a method of the client class.

Further example The InputStream and the DataInput are abstract interface objects. The link between OrderReader and DataInput is a dependency. It shows that OrderReader uses the DataInput interface for some purpose. The link between DataInputStream and DataInput is a refinement. This indicates a greater level of detail. Generalisation Dependency Refinement

Generating Code From your ROSE model

Set up your path Create a directory for this work, such as U:\ROSE\StudentCode Edit the model properties (Tools>Model Properties>Edit) Click the Notation tab and choose Java as the default language.

Set up the class path (Tools>Java>Project Specification Click the ‘new folder’ icon. Click the three dots. Browse to find the correct directory.

Click OK When the correct directory is shown, click Apply.

For each class to be generated… Package classes –E.g. place all classes into a single package. Later, we will discuss strategies for packaging. –To do this, add a package to the logical view and drag all the classes you need into it. –Select each class and click Tools>Java>Generate Code –Click Assign to assign your class to the chosen class path. –You may get generation errors.

Typical errors Errors occur due to incompatibility between your model and the target language. E.g. –10:44:57| WARNING: Class Logical View::OM_claim::Accident - the name of attribute Accident date/time is not a valid Java identifier. 10:44:57| ERROR: Class Logical View::OM_claim::Accident - a name which is a valid Java identifier cannot be constructed for attribute Accident date/time 10:45:16| Starting Code Generation 10:45:16| WARNING: Class Logical View::OM_claim::Accident - the name of attribute Accident date/time is not a valid Java identifier. 10:45:16| ERROR: Class Logical View::OM_claim::Accident - a name which is a valid Java identifier cannot be constructed for attribute Accident date/time Note, these are errors due to an incompatibility between the given names and the Java language. –i.e. you cannot call a field “Accident date / time”.

Error handling Return to the class diagram and fix the problems. Generate again. This dialogue is displayed: Insert a new classpath as shown on the next slide Returning to the Classpaths dialogue, click on the component and click ‘Assign’. The component then disappears from the RHS of the screen. When the code generation is complete, hopefully you will get ‘Code generation completed successfully’ The following code has been generated into the folder:

Data model generation Using SQL Server

Converting classes to tables Classify the classes, using a 3-tier system –Tick the ‘Three-tier diagram’ box in the tools - options menu in Rational Rose. Move all persistent classes into a single package. For each persistent business class: –Open the standard specification –Select the ‘detail’ tab –Turn on the ‘persistent’ radio button.

Using the Data Modeler Using the component view –Set up a database Right click on component view, choose data modeler, new, database. –Open the specification for the database and choose the target database depending on the implementation route (e.g. SQL Server 2000) In the logical view –Set up a new schema Right click on logical view, choose data modeler, new, schema. Open the schema specification. Associate it with the database you have created.

Right click on the package in the Logical view Choose data modeler Choose ‘Transform to data model’ Fill in destination schema and target database.

Result This creates a set of tables in the database. You can view them by setting up a new data model diagram. –Right click on schema –Choose data modeler –Choose new –Choose data model diagram

Generating SQL Right click on the database Choose Data modeler Forward Engineer…