And so to Code. Forward, Reverse, and Round-Trip Engineering Forward Engineering Reverse Engineering Round-Trip Engineering.

Slides:



Advertisements
Similar presentations
CS18000: Problem Solving and Object-Oriented Programming.
Advertisements

BTS430 Design Model: Sequence Diagrams involving collections.
Chapter 7 – Object-Oriented Design
Unified Modeling Language
The University of Anytown School of Business Computing.
Designing Classes Chapter 3. 2 Chapter Contents Encapsulation Specifying Methods Java Interfaces Writing an Interface Implementing an Interface An Interface.
Satzinger, Jackson, and Burd Object-Orieneted Analysis & Design
Overview of a Simple Development Method. Background Before discussing some specific methods we will consider a simple method that doesn’t have a name.
Objectives Explain the purpose and objectives of object- oriented design Develop design class diagrams Develop interaction diagrams based on the principles.
Distribution of Marks Internal Sessional Evaluation Assignments – 10 Quizzes – 10 Class Participation Attendence – 5 Mid – Term Test – 25 External Evaluation.
ACM/JETT Workshop - August 4-5, 2005 UML Modeling using MagicDraw UML for Java Programmers.
Designing with Interaction and Design Class Diagrams Chapters 15 & 16 Applying UML and Patterns Craig Larman With some ideas from students in George Blank’s.
Object-Oriented Analysis and Design
Multiple Choice Solutions True/False a c b e d   T F.
Neo.NET Entity Objects Design Goals Copyright © Erik Dörnenburg – Last updated: May 2004.
The Design Discipline.
Systems Analysis and Design in a Changing World, Fifth Edition
Outline Introduction Problem Statement Object-Oriented Design Aspect-Oriented Design Conclusion Demo.
Mapping Designs to Code Larman, Chapter 20 CSE432 Object Oriented Software Engineering.
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 1 System models l Abstract descriptions of systems whose requirements are being.
PowerDesigner 与对象建模. 2 Why Using UML? Visually define and communicate the structure and behavior of an application Represent systems using Object-Oriented.
Courier Tracking System. Small Courier Operations Small courier services collect Letters and parcels from customers and issues its own POD number Then.
1 SAD2 - UML 4 th Lecture Class Diagram in Construction Phase Patterns Case Study Lecturer: Dr Dimitrios Makris
Chapter 26 GoF Design Patterns. The Adapter Design Pattern.
1 ITEC 3010 “Systems Analysis and Design, I” LECTURE 10: Use Case Realizations [Prof. Peter Khaiter]
Object Oriented Design Jerry KotubaSYST Object Oriented Methodologies1.
ICONIX P ROCESS FOR S OFTWARE D EVELOPMENT Hoang Huu Hanh, Hue University hanh-at-hueuni.edu.vn 1.
System models l Abstract descriptions of systems whose requirements are being analysed.
Systems Analysis and Design in a Changing World, 3rd Edition
® IBM Software Group © 2006 IBM Corporation Rational Software France Object-Oriented Analysis and Design with UML2 and Rational Software Modeler 02. Objects,
Domain Model Classes and Objects Association Structure Requirement Specification Domain Model.
Design Class Diagrams (DCDs)
Chapter 16 Applying UML and Patterns Craig Larman
NJIT UML Class Diagrams Chapter 16 Applying UML and Patterns Craig Larman.
Domain Model Classes and Objects Association Structure Requirement Specification Domain Model.
Designing Classes Chapter 3. 2 Chapter Contents Encapsulation Specifying Methods Java Interfaces Writing an Interface Implementing an Interface An Interface.
Topic 1 Object Oriented Programming. 1-2 Objectives To review the concepts and terminology of object-oriented programming To discuss some features of.
Object Oriented Analysis: Associations. 2 Object Oriented Modeling BUAD/American University Class Relationships u Classes have relationships between each.
Domain Classes – Part 1.  Analyze Requirements as per Use Case Model  Domain Model (Conceptual Class Diagram)  Interaction (Sequence) Diagrams  System.
Ch- 8. Class Diagrams Class diagrams are the most common diagram found in modeling object- oriented systems. Class diagrams are important not only for.
Use Case Textual Analysis
CSE 219 Computer Science III UML. UML Diagrams UML - Unified Modeling Language UML diagrams are used to design object-oriented software systems –represent.
12 OBJECT-ORIENTED DESIGN CHAPTER
Object Oriented Analysis and Design 1 Chapter 9 From Design to Implementation  Implementation Model  Forward, Reverse, and Round-Trip Engineering  Mapping.
Class Diagrams. Terms and Concepts A class diagram is a diagram that shows a set of classes, interfaces, and collaborations and their relationships.
Presented by Ted Higgins, SQL Server DBA An Introduction to Object – Oriented Programming.
Kyung Hee University Class Diagramming Notation OOSD 담당조교 석사과정 이정환.
Object Oriented Programming and Data Abstraction Earl Huff Rowan University.
High Level Design Use Case Textual Analysis SE-2030 Dr. Mark L. Hornick 1.
Object Oriented Analysis & Design By Rashid Mahmood.
Introduction to Unified Modeling Language (UML) By Rick Mercer with help from The Unified Modeling Language User Guide, Grady Booch, James Rumbaugh, Ivar.
11 Systems Analysis and Design in a Changing World, Fifth Edition.
IB Computer Science Content developed by Dartford Grammar School Computer Science Department UML.
Object-oriented and Structured System Models
2.7 Inheritance Types of inheritance
Chapter 1 OBJECT-ORIENTED ANALYSIS AND DESIGN
Unified Modeling Language
Introduction to Unified Modeling Language (UML)
Prepared By Sidra Noureen
The Object Oriented Approach to Design
Component-Level Design
GRASP (General Responsibility Assignment Software Patterns)
Introduction to Unified Modeling Language (UML)
Design and Implementation
Software Design Lecture : 15.
Chapter 11: Class Diagram
Chapter 6: Structured Vs. Object Oriented Analysis and Design.
Chapter 22 Object-Oriented Systems Analysis and Design and UML
UML  UML stands for Unified Modeling Language. It is a standard which is mainly used for creating object- oriented, meaningful documentation models for.
Chapter 11: Class Diagram
Presentation transcript:

And so to Code

Forward, Reverse, and Round-Trip Engineering Forward Engineering Reverse Engineering Round-Trip Engineering

Forward Engineering Forward engineering means the generation of code from UML diagrams Many of the tools can only do the static models: – They can generate class diagrams from code, but can't generate interaction diagrams. – For forward engineering, they can generate the basic (e.g., Java) class definition from a class diagram, but not the method bodies from interaction diagrams. Demo Generate

Reverse Engineering Reverse engineering means generation of UML diagrams from code Demo Re-Engineer

Round-Trip Engineering Round-trip engineering closes the loop – the tool supports generation in either direction and can synchronize between UML diagrams and code, ideally automatically and immediately as either is changed. Demo

Mapping Designs to Code Creating Class Definitions from Class Diagram Creating Methods from Interaction Diagrams Using Collection Classes to implement relationships Code

Creating Class Definitions from Class Diagram

Creating Methods from Interaction Diagrams

Collection Classes in Code

.NET Sequence & Object Diagrams Exercises

1. Draw a sequence diagram to model the following code public class Cat { private Person owner; public void Kick() { Meow(); owner.Bite(); } public void Meow() { } public class Person { private Cat cat; public void KickCat() { // start here cat.Kick(); } public void Bite() { } public class Cat { private Person owner; public void Kick() { Meow(); owner.Bite(); } public void Meow() { } public class Person { private Cat cat; public void KickCat() { // start here cat.Kick(); } public void Bite() { }

Solution public class Cat { private Person owner; public void Kick() { Meow(); owner.Bite(); } public void Meow() { } public class Person { private Cat cat; public void KickCat() { // start here cat.Kick(); } public void Bite() { } public class Cat { private Person owner; public void Kick() { Meow(); owner.Bite(); } public void Meow() { } public class Person { private Cat cat; public void KickCat() { // start here cat.Kick(); } public void Bite() { } /owner : Personcat : Cat Kick() Meow() Bite()

2. Draw a sequence diagram to model the following code public class Cat { private Person owner; public void Kick() { Meow(); if(owner != null) { owner.Bite(); } public void Meow() { } public class Person { private IList cats; public void KickCat() { // start here foreach(Cat cat in cats) { cat.Kick(); } public void Bite() { } public class Cat { private Person owner; public void Kick() { Meow(); if(owner != null) { owner.Bite(); } public void Meow() { } public class Person { private IList cats; public void KickCat() { // start here foreach(Cat cat in cats) { cat.Kick(); } public void Bite() { } /owner : Personcat : Cat Kick() Meow() [owner != null] Bite() [for each cat in cats]

Solution public class Cat { private Person owner; public void Kick() { Meow(); if(owner != null) { owner.Bite(); } public void Meow() { } public class Person { private IList cats; public void KickCat() { // start here foreach(Cat cat in cats) { cat.Kick(); } public void Bite() { } public class Cat { private Person owner; public void Kick() { Meow(); if(owner != null) { owner.Bite(); } public void Meow() { } public class Person { private IList cats; public void KickCat() { // start here foreach(Cat cat in cats) { cat.Kick(); } public void Bite() { }

UML Exercises : Class Diagrams for.NET Developers

Draw a class diagram based on the following code public class Whiskey { private IList tangos; public Whiskey() { tangos = new ArrayList(); } public void AddTango(Tango tango) { tangos.Add(tango); } public class Tango : Foxtrot { public void Lima() { } public interface Foxtrot { void Lima(); } public class Whiskey { private IList tangos; public Whiskey() { tangos = new ArrayList(); } public void AddTango(Tango tango) { tangos.Add(tango); } public class Tango : Foxtrot { public void Lima() { } public interface Foxtrot { void Lima(); } Whiskey Whiskey() AddTango(tango : Tango) Tango Lima() * tangos > Foxtrot Lima() Multiplicity at this end is ambiguous

Solution public class Whiskey { private IList tangos; public Whiskey() { tangos = new ArrayList(); } public void AddTango(Tango tango) { tangos.Add(tango); } public class Tango : Foxtrot { public void Lima() { } public interface Foxtrot { void Lima(); } public class Whiskey { private IList tangos; public Whiskey() { tangos = new ArrayList(); } public void AddTango(Tango tango) { tangos.Add(tango); } public class Tango : Foxtrot { public void Lima() { } public interface Foxtrot { void Lima(); }

4. Draw a class diagram based on the following code Party # id : int FullName() : string Person -firstName : string -lastName : string FirstName() : string FirstName(value : string) LastName() : string LastName(value : string) FullName() : string = firstName + “ “ + lastName

Solution public abstract class Party { protected int id; public abstract string FullName { get; } } public class Person : Party { private string firstName; private string lastName; public string FirstName { get { return firstName; } set { firstName = value; } } public string LastName { get { return lastName; } set {lastName = value; } } public override string FullName { get { return firstName + " " + lastName; } } public abstract class Party { protected int id; public abstract string FullName { get; } } public class Person : Party { private string firstName; private string lastName; public string FirstName { get { return firstName; } set { firstName = value; } } public string LastName { get { return lastName; } set {lastName = value; } } public override string FullName { get { return firstName + " " + lastName; } }

Three Very Simple Use Cases Create New Supplier Delete Supplier Update Supplier Details Let’s consider some coding issues!

One “Entity” Class

Three Control Classes Create New Supplier Delete Supplier Update Supplier Details

One Boundary Class for all Three Use Cases

One Boundary Class

One Class to Talk to the Database

Sequence Diagram for Create New Supplier Supplier Form Control Class “Create Supplier” Entity Class “Supplier” DB Connection DBSupplier

Overview of the System Architecture

Project Window for the entire application

More Sophisticated Use Cases Perhaps we could ask the Customer object to: – Project future sales to this customer. This would involve analysing past sales to identify trends. Implies the need for a “Customer Sales History” class not currently included in the model. – Collect overdue payments. This would involve generating standard letters to be sent to the customer. Implies collaboration with a “Payment” class (associated with Order or Invoice?) not currently included in the model.

Another Case Study

A Domain Model

A Class Diagram

Background to Naked Objects

‘Best practice’ in contemporary business systems design splits an application into four principal layers Presentation Application, Process, Task or Controller Domain object model Persistence

But “The Naked Objects Pattern” eliminates the controller layer by encapsulating all business functionality on the entity objects Presentation Application, Process or Use-case controller Domain object model Persistence

And has a generic presentation layer that automatically reflects the domain object model as an object-oriented user interface Presentation Application, Process or Use-case controller Domain object model Persistence

CarServ: A tale of two business applications

Good Idea? One of the research topics for the coursework element of this module Final project???