SlideShare a Scribd company logo
MAPPING DESIGNS TO CODE Atoi Software System Bangalore  [email_address]
Objectives: Map design artifacts to code in an OO- language(JAVA). Introduction: The UML artifacts created during the design phase – collaboration diagrams and design class diagrams – will be used as input to the code generation process. In ROSE – you need only Class Diagram .
Mapping Designs to Code: Public class SalesLineItem { Public SalesLineItem(ProductSpecification spec,int qty); Public float subtotal(); Private int quantity; } Note  the addition of the Java Constructor SalesLineItem(…) is derived From the fact that a create(spec,qty) message is sent to a SalesLineItem In the enter item collaboration diagram.
Adding Reference Attributes A reference attribute is an attribute that referes to another complex object, not to a primitive type such as a string, Number, and so on. The Reference attributes of a class are suggested by the associations and navigability in a class diagram Public class SalesLineItem { public SalesLineItem(ProductSpecification spec,int qty); public float subtotal(); private int quantity; private ProductSpecification prodSpec; } // simple attribute //Reference attribute
Reference Attributes & Role Name Role name  is a name that identifies the role and often provides some semantic context as the nature of the role. If Role name is present in a class diagram , use it as the basis for the name of the reference attribute  during code generation. prodSpec Public class SalesLineItem { public SalesLineItem(ProductSpecification spec,int qty); public float subtotal(); private int quantity; private ProductSpecification prodSpec; } // simple attribute //Reference attribute
Writing Methods with help of collaboration Diagram The sequence of messages shown in the collaboration diagram will be translated to a series of statements in the method definition. Nest Slide>>>
POST – enterItem Method public class POST { public POST(ProductCatalog pc); public void endSale(); public void enterItem(int upc,int qty); public void makePayment(float cashTendered); Private ProductCatalog prodCatalog; // reference attributes Private Sale sale; } Public Void enterItem( int upc, int qty)  Message 1  (create sale if new)>> if(isNewSale()){ sale = new Sale();} Message 2  send getspec for catalog to retrieve productspec ProductSpecification spec =    productCatalog.specification(upc); Message 3  : send makelineItem to sale Sale.makeLineItem(spec,qty)
The POST – isNewSale Method Note this isNewSale this was not mentioned anywhere in our collaboration diagram but during coding phase changes form the design will appear ( which is inevitable and natural ), but keep in mind to make changes in the related artifacts and document the changes thoroughly. private boolean isNewSale() { return ( sale == null) || ( sale.isComplete() ); }
Sale – makeLineItem Method Public void makeLineItem(ProductSpecification spec, int qty) {  // implementation of message 4.1 and 4.2 lineItem.addElements(new SaleLineItem(spec,qty); }

More Related Content

PPT
C# Tutorial MSM_Murach chapter-06-slides
PPT
C# Tutorial MSM_Murach chapter-08-slides
PDF
Intake 38 7
PPT
C# Tutorial MSM_Murach chapter-12-slides
PPT
C# Tutorial MSM_Murach chapter-15-slides
PDF
Intake 38 9
PPT
C# Tutorial MSM_Murach chapter-11-slides
PPT
C# Tutorial MSM_Murach chapter-13-slides
C# Tutorial MSM_Murach chapter-06-slides
C# Tutorial MSM_Murach chapter-08-slides
Intake 38 7
C# Tutorial MSM_Murach chapter-12-slides
C# Tutorial MSM_Murach chapter-15-slides
Intake 38 9
C# Tutorial MSM_Murach chapter-11-slides
C# Tutorial MSM_Murach chapter-13-slides

What's hot (7)

PPT
C# Tutorial MSM_Murach chapter-24-slides
PPT
C# Tutorial MSM_Murach chapter-04-slides
PPT
C# Tutorial MSM_Murach chapter-03-slides
PPT
C# Tutorial MSM_Murach chapter-19-slides
PPT
C# Tutorial MSM_Murach chapter-09-slides
PPT
C# Tutorial MSM_Murach chapter-23-slides
PPT
C# Tutorial MSM_Murach chapter-07-slides
C# Tutorial MSM_Murach chapter-24-slides
C# Tutorial MSM_Murach chapter-04-slides
C# Tutorial MSM_Murach chapter-03-slides
C# Tutorial MSM_Murach chapter-19-slides
C# Tutorial MSM_Murach chapter-09-slides
C# Tutorial MSM_Murach chapter-23-slides
C# Tutorial MSM_Murach chapter-07-slides
Ad

Viewers also liked (20)

PPS
11 ooad uml-14
ODP
DOC
Dbms Lecture Notes
PDF
UML Diagrams- Unified Modeling Language Introduction
PDF
Entity Relationship Diagram
PPT
Mis ppt unit 3 & 4
PDF
Latest trends in database management
PPTX
Unit 3 Management Information System
PPTX
Current trends in DBMS
PPTX
Case tools
PPT
Management Information System-MIS
PPS
Data models
PPTX
DFD, Decision Table, Decision Chart, Structure Charts
PPT
Entity Relationship Diagram
PPT
System analysis and design
PPT
UML for OOAD
PPT
Dbms models
PPT
Information Systems Analysis and Design Overview of OOAD, UML, and RUP
PPT
OOAD UNIT I UML DIAGRAMS
PPTX
Data Modeling PPT
11 ooad uml-14
Dbms Lecture Notes
UML Diagrams- Unified Modeling Language Introduction
Entity Relationship Diagram
Mis ppt unit 3 & 4
Latest trends in database management
Unit 3 Management Information System
Current trends in DBMS
Case tools
Management Information System-MIS
Data models
DFD, Decision Table, Decision Chart, Structure Charts
Entity Relationship Diagram
System analysis and design
UML for OOAD
Dbms models
Information Systems Analysis and Design Overview of OOAD, UML, and RUP
OOAD UNIT I UML DIAGRAMS
Data Modeling PPT
Ad

Similar to (OOAD) UML Slides (20)

PPT
11MappingDesigntoCode.ppt Software engineering
PPT
11MappingDesigntoCode.ppt ooad software software
PDF
.NET Portfolio
PPT
03 Object Relational Mapping
PDF
Infinum Android Talks #15 - Garfield Android Studio Plugin - Be Smart, Be Lazy
PDF
Visual C++ project model
ODP
Treinamento Qt básico - aula II
PDF
It's complicated, but it doesn't have to be: a Dagger journey
PDF
Design patterns for fun and profit
ODP
Qt Workshop
PDF
Factory method pattern (Virtual Constructor)
PPTX
PPTX
Software System Architecture-Lecture 6.pptx
PDF
Integrazione QML / C++
PDF
Sketchmine: Design Systems Tooling
PPTX
Writing Kotlin Multiplatform libraries that your iOS teammates are gonna love
PPT
Developing and Benchmarking Qt applications on Hawkboard with Xgxperf
PDF
Presentation on design pattern software project lll
PDF
DDD - 2 - Domain Driven Design: Tactical design.pdf
11MappingDesigntoCode.ppt Software engineering
11MappingDesigntoCode.ppt ooad software software
.NET Portfolio
03 Object Relational Mapping
Infinum Android Talks #15 - Garfield Android Studio Plugin - Be Smart, Be Lazy
Visual C++ project model
Treinamento Qt básico - aula II
It's complicated, but it doesn't have to be: a Dagger journey
Design patterns for fun and profit
Qt Workshop
Factory method pattern (Virtual Constructor)
Software System Architecture-Lecture 6.pptx
Integrazione QML / C++
Sketchmine: Design Systems Tooling
Writing Kotlin Multiplatform libraries that your iOS teammates are gonna love
Developing and Benchmarking Qt applications on Hawkboard with Xgxperf
Presentation on design pattern software project lll
DDD - 2 - Domain Driven Design: Tactical design.pdf

More from Rajesh Kumar (20)

PDF
Fundamental of apache maven
PDF
Git and github fundamental
PDF
Tools for quality matrix and kloc
PDF
Cast vs sonar
PDF
Cast vs sonar
PDF
Testing in a glance
PDF
Rpm cheatbook
PDF
Code coverage & tools
PDF
Scm process assessment guide
PPT
Cruise control
PPT
Cloud computer
PPTX
Branching and Merging Practices
PPSX
SCM Process and smartBuild
PPT
Why Scm
PPT
Version Control With CVS
PPT
Using Ant To Build J2 Ee Applications
PPT
Software Configuration Management And CVS
PPT
Scm With Mks Integrity
PPT
Introduction To Software Configuration Management
PPT
Introduction To Ant
Fundamental of apache maven
Git and github fundamental
Tools for quality matrix and kloc
Cast vs sonar
Cast vs sonar
Testing in a glance
Rpm cheatbook
Code coverage & tools
Scm process assessment guide
Cruise control
Cloud computer
Branching and Merging Practices
SCM Process and smartBuild
Why Scm
Version Control With CVS
Using Ant To Build J2 Ee Applications
Software Configuration Management And CVS
Scm With Mks Integrity
Introduction To Software Configuration Management
Introduction To Ant

Recently uploaded (20)

PDF
cuic standard and advanced reporting.pdf
PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PPTX
Machine Learning_overview_presentation.pptx
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Approach and Philosophy of On baking technology
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Electronic commerce courselecture one. Pdf
PDF
Machine learning based COVID-19 study performance prediction
PDF
A comparative analysis of optical character recognition models for extracting...
PPTX
Big Data Technologies - Introduction.pptx
cuic standard and advanced reporting.pdf
Network Security Unit 5.pdf for BCA BBA.
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Review of recent advances in non-invasive hemoglobin estimation
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Machine Learning_overview_presentation.pptx
Mobile App Security Testing_ A Comprehensive Guide.pdf
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Approach and Philosophy of On baking technology
NewMind AI Weekly Chronicles - August'25-Week II
Unlocking AI with Model Context Protocol (MCP)
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
The Rise and Fall of 3GPP – Time for a Sabbatical?
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Advanced methodologies resolving dimensionality complications for autism neur...
MIND Revenue Release Quarter 2 2025 Press Release
Electronic commerce courselecture one. Pdf
Machine learning based COVID-19 study performance prediction
A comparative analysis of optical character recognition models for extracting...
Big Data Technologies - Introduction.pptx

(OOAD) UML Slides

  • 1. MAPPING DESIGNS TO CODE Atoi Software System Bangalore [email_address]
  • 2. Objectives: Map design artifacts to code in an OO- language(JAVA). Introduction: The UML artifacts created during the design phase – collaboration diagrams and design class diagrams – will be used as input to the code generation process. In ROSE – you need only Class Diagram .
  • 3. Mapping Designs to Code: Public class SalesLineItem { Public SalesLineItem(ProductSpecification spec,int qty); Public float subtotal(); Private int quantity; } Note the addition of the Java Constructor SalesLineItem(…) is derived From the fact that a create(spec,qty) message is sent to a SalesLineItem In the enter item collaboration diagram.
  • 4. Adding Reference Attributes A reference attribute is an attribute that referes to another complex object, not to a primitive type such as a string, Number, and so on. The Reference attributes of a class are suggested by the associations and navigability in a class diagram Public class SalesLineItem { public SalesLineItem(ProductSpecification spec,int qty); public float subtotal(); private int quantity; private ProductSpecification prodSpec; } // simple attribute //Reference attribute
  • 5. Reference Attributes & Role Name Role name is a name that identifies the role and often provides some semantic context as the nature of the role. If Role name is present in a class diagram , use it as the basis for the name of the reference attribute during code generation. prodSpec Public class SalesLineItem { public SalesLineItem(ProductSpecification spec,int qty); public float subtotal(); private int quantity; private ProductSpecification prodSpec; } // simple attribute //Reference attribute
  • 6. Writing Methods with help of collaboration Diagram The sequence of messages shown in the collaboration diagram will be translated to a series of statements in the method definition. Nest Slide>>>
  • 7. POST – enterItem Method public class POST { public POST(ProductCatalog pc); public void endSale(); public void enterItem(int upc,int qty); public void makePayment(float cashTendered); Private ProductCatalog prodCatalog; // reference attributes Private Sale sale; } Public Void enterItem( int upc, int qty) Message 1 (create sale if new)>> if(isNewSale()){ sale = new Sale();} Message 2 send getspec for catalog to retrieve productspec ProductSpecification spec = productCatalog.specification(upc); Message 3 : send makelineItem to sale Sale.makeLineItem(spec,qty)
  • 8. The POST – isNewSale Method Note this isNewSale this was not mentioned anywhere in our collaboration diagram but during coding phase changes form the design will appear ( which is inevitable and natural ), but keep in mind to make changes in the related artifacts and document the changes thoroughly. private boolean isNewSale() { return ( sale == null) || ( sale.isComplete() ); }
  • 9. Sale – makeLineItem Method Public void makeLineItem(ProductSpecification spec, int qty) { // implementation of message 4.1 and 4.2 lineItem.addElements(new SaleLineItem(spec,qty); }