SlideShare a Scribd company logo
1 of 40
Arab Open University
2nd
Semester, 2006-2007
M301
Unit 5.1
From Model to
Implementation
reem.attas@arabou.org.sa
Reem AlAttas © 2
Topic Road Map
 Moving towards Implementation
From Requirements to Code
Controlling Inheritance
Using Tools to Automate Development
Modeling Implementation and Deployment
Reem AlAttas © 3
When do you stop modeling?
When it is easier to construct code than
building more models.
Reem AlAttas © 4
Using activity diagrams for operations
Activity diagrams:
 Show the flow of control from one activity to
another.
 Used to investigate the different scenarios in a
use case.
 Show the steps required to collect the set of
rules governing an operation.
Reem AlAttas © 5
Class model shows payments made
against a hotel bill
Reem AlAttas © 6
A set of rules for payment
authorization
 The hotel need to authorize a payment by
cheque or credit card.
Reem AlAttas © 7
Sequence diagrams
Used to illustrate the possible scenarios
for performing a use case.
Reem AlAttas © 8
An example of cheque authorization
 One of the hotel’s managers, John, has authorized a
cheque, p101, for payment against a bill, b99.
Reem AlAttas © 9
Topic Road Map
Moving towards Implementation
 From Requirements to Code
Controlling Inheritance
Using Tools to Automate Development
Modeling Implementation and Deployment
Reem AlAttas © 10
From requirements to implementation
Pre- and post-conditions were recoded in
natural language.
If you want to incorporate them into Java
code as executable statements, you will
need to express them in the Java
language.
Reem AlAttas © 11
Assertion
A statement that can be true or false in a
similar way that a Boolean expression will
be either true or false in Java.
Reem AlAttas © 12
An ‘extended’ Java syntax for an
assertion handling
 @pre indicates the value of the expression when
the method started its execution.
Reem AlAttas © 13
The absence of pre- or post-
conditions
 This does not mean that no pre-condition
applies: it is simply a way of saying that the pre-
condition is true.
Reem AlAttas © 14
Not all assertions are easy to express
in a programming language
If it is not possible to express an assertion
formally (in a programming language) it is
good practice to include it informally (in
natural language).
This can be done by including its natural
language version as a comment in the
appropriate pre, post or invariant clause.
Reem AlAttas © 15
… Not all assertions are easy to
express in a programming language
Reem AlAttas © 16
Invariants and their relationship to pre-
and post-conditions
 The invariant is considered as part of both the
pre- and the post-conditions.
 Before a method can be executed both the invariant and
the pre-condition must hold.
 After the method has completed, the invariant and the
post-condition must hold.
Reem AlAttas © 17
The supplier code
 The implementation (code) of a method.
Reem AlAttas © 18
The client code
 How to call the method?
 Suppose that acct1 is an object of type
BankAccount.
Reem AlAttas © 19
Monitoring assertions
Reem AlAttas © 20
Topic Road Map
Moving towards Implementation
From Requirements to Code
 Controlling Inheritance
Using Tools to Automate Development
Modeling Implementation and Deployment
Reem AlAttas © 21
Forms of Inheritance
Inheritance for
 Specialization.
 Specification.
 Construction.
Reem AlAttas © 22
Inheritance without redefinition of
methods
 Since SavingsAccount
and
SpecialSavingsAccount
are related via
generalization, it means
that an object of class
SpecialSavingsAccount
is-a object of class
SavingsAccount.
Reem AlAttas © 23
… Inheritance without redefinition of
methods
The methods that SpecialSavingsAccount
inherits from SavingsAccount have the
same contracts as those in
SavingsAccount.
Inheritance without redefinition guarantees
that this will be the case.
Reem AlAttas © 24
Inheritance with redefinition
 Redefined methods
automatically inherit the
pre- and post-conditions
of their parent methods.
 Any invariant clause of
the parent class should
also be inherited by the
child class.
addInterest ()
Reem AlAttas © 25
Topic Road Map
Moving towards Implementation
From Requirements to Code
Controlling Inheritance
 Using Tools to Automate Development
Modeling Implementation and Deployment
Reem AlAttas © 26
Definitions
 Engineering: generic term often used to describe the
building of an artifact (e.g. software, car, rocket) from
some kind of model.
 Forward engineering: is a synonym for the engineering
process that is often used in CASE tools.
 Code generation: the normal forward engineering
process which automatically generates code.
Reem AlAttas © 27
... Definitions
Reverse engineering: is the derivation of
a model from an artifact (which, in the
case of S/W engineering is usually source
code).
Reem AlAttas © 28
... Definitions
 Round-trip engineering: going from model to
code and back again (perhaps repeatedly) to
ensure the consistency between model and
code.
 Simultaneous round-trip engineering: edit
code or model and have the other updated
automatically.
Reem AlAttas © 29
Topic Road Map
Moving towards Implementation
From Requirements to Code
Controlling Inheritance
Using Tools to Automate Development
 Modeling Implementation and
Deployment
Reem AlAttas © 30
Nodes (processing resources)
Run-time, physical objects which have at
least a memory and often processing
capability as well.
Nodes include:
 computing devices.
 human resources.
 mechanical processing resources.
Reem AlAttas © 31
Real-world constraint on how a system
may be built and maintained
 The current capabilities of the technology and
probably the budget of the customer.
 Non-functional requirements, such as response
time or robustness, cannot be modeled.
 The programming language and the
environment in which it is coded and
documented.
Reem AlAttas © 32
Component
Any distributable part of a system, which
might include executable software, source
code for the software, user manuals or
documentation, or even a specialized
piece of hardware.
If an object can be touched, or stored on a
medium that can be touched, then it can
be a component.
Reem AlAttas © 33
Component Symbol
Reem AlAttas © 34
A simple component diagram showing
a dependency
class
Reem AlAttas © 35
Simple Java program & its
corresponding component diagram
Reem AlAttas © 36
Deployment diagram
 Indicates only the components that are active at
run-time.
Reem AlAttas © 37
Deployment diagram for home banking
Reem AlAttas © 38
Packages
class
TMA5 – Q1
Thank You!

More Related Content

Viewers also liked

magnetojet_proposal
magnetojet_proposalmagnetojet_proposal
magnetojet_proposalJack Rollan
 
The colors
The colorsThe colors
The colorsyury90
 
Fundamenteel Eerste Hulp Voor Medische Noodgevallen
Fundamenteel Eerste Hulp Voor Medische  NoodgevallenFundamenteel Eerste Hulp Voor Medische  Noodgevallen
Fundamenteel Eerste Hulp Voor Medische NoodgevallenRonald Loermans
 
From Model to Implementation II
From Model to Implementation IIFrom Model to Implementation II
From Model to Implementation IIReem Alattas
 
A personal finance jb
A personal finance jbA personal finance jb
A personal finance jbJohn Becker
 
Dialogg @ APPlicera hälsa, Forum för Välfärd
Dialogg @ APPlicera hälsa, Forum för VälfärdDialogg @ APPlicera hälsa, Forum för Välfärd
Dialogg @ APPlicera hälsa, Forum för VälfärdMarcus Linder
 
Cancer al cuello uterino
Cancer al cuello uterinoCancer al cuello uterino
Cancer al cuello uterinoCatalina Solano
 

Viewers also liked (10)

Treball definitiu
Treball definitiuTreball definitiu
Treball definitiu
 
magnetojet_proposal
magnetojet_proposalmagnetojet_proposal
magnetojet_proposal
 
The colors
The colorsThe colors
The colors
 
Teoria 1
Teoria 1Teoria 1
Teoria 1
 
Fundamenteel Eerste Hulp Voor Medische Noodgevallen
Fundamenteel Eerste Hulp Voor Medische  NoodgevallenFundamenteel Eerste Hulp Voor Medische  Noodgevallen
Fundamenteel Eerste Hulp Voor Medische Noodgevallen
 
From Model to Implementation II
From Model to Implementation IIFrom Model to Implementation II
From Model to Implementation II
 
actividades
actividadesactividades
actividades
 
A personal finance jb
A personal finance jbA personal finance jb
A personal finance jb
 
Dialogg @ APPlicera hälsa, Forum för Välfärd
Dialogg @ APPlicera hälsa, Forum för VälfärdDialogg @ APPlicera hälsa, Forum för Välfärd
Dialogg @ APPlicera hälsa, Forum för Välfärd
 
Cancer al cuello uterino
Cancer al cuello uterinoCancer al cuello uterino
Cancer al cuello uterino
 

Similar to From Modeling to Code Generation in UML

Process Quality Management, Human Resources, Quality Assurance
Process Quality Management, Human Resources, QualityAssuranceProcess Quality Management, Human Resources, QualityAssurance
Process Quality Management, Human Resources, Quality AssuranceReem Alattas
 
Approaches to Software Development
Approaches to Software DevelopmentApproaches to Software Development
Approaches to Software DevelopmentReem Alattas
 
Reactive applications tools of the trade huff po
Reactive applications   tools of the trade huff poReactive applications   tools of the trade huff po
Reactive applications tools of the trade huff poshinolajla
 
"Concurrent React 18. "I might do it later"", Mykola Yenin
"Concurrent React 18. "I might do it later"", Mykola Yenin "Concurrent React 18. "I might do it later"", Mykola Yenin
"Concurrent React 18. "I might do it later"", Mykola Yenin Fwdays
 
SRE - drupal day aveiro 2016
SRE - drupal day aveiro 2016SRE - drupal day aveiro 2016
SRE - drupal day aveiro 2016Ricardo Amaro
 
What is the Next Generation for Application Managed Services?
What is the Next Generation for Application Managed Services?What is the Next Generation for Application Managed Services?
What is the Next Generation for Application Managed Services?Hexaware Technologies
 
Business Utility Application
Business Utility ApplicationBusiness Utility Application
Business Utility ApplicationIRJET Journal
 
Accelerate Application Migration - August 5, 2020
Accelerate Application Migration - August 5, 2020Accelerate Application Migration - August 5, 2020
Accelerate Application Migration - August 5, 2020VMware Tanzu
 
Which is better asp.net mvc vs asp.net
Which is better  asp.net mvc vs asp.netWhich is better  asp.net mvc vs asp.net
Which is better asp.net mvc vs asp.netConcetto Labs
 
Enterprise SCADA Standardization - Nov 2010 - Digital Oilfield.PDF
Enterprise SCADA Standardization - Nov 2010 - Digital Oilfield.PDFEnterprise SCADA Standardization - Nov 2010 - Digital Oilfield.PDF
Enterprise SCADA Standardization - Nov 2010 - Digital Oilfield.PDFsmrobb
 
Product Quality: Metrics, Verification, Validation, Testing
Product Quality: Metrics, Verification, Validation, TestingProduct Quality: Metrics, Verification, Validation, Testing
Product Quality: Metrics, Verification, Validation, TestingReem Alattas
 
What are Software Testing Methodologies | Software Testing Techniques | Edureka
What are Software Testing Methodologies | Software Testing Techniques | EdurekaWhat are Software Testing Methodologies | Software Testing Techniques | Edureka
What are Software Testing Methodologies | Software Testing Techniques | EdurekaEdureka!
 
Memory Management in Trading Platforms
Memory Management in Trading PlatformsMemory Management in Trading Platforms
Memory Management in Trading PlatformsIRJET Journal
 
Performance Testing
Performance TestingPerformance Testing
Performance TestingvodQA
 
Best Practices & Lessons Learned from the field on EMC Documentum xCP 2.0
Best Practices & Lessons Learned from the field on EMC Documentum xCP 2.0Best Practices & Lessons Learned from the field on EMC Documentum xCP 2.0
Best Practices & Lessons Learned from the field on EMC Documentum xCP 2.0Haytham Ghandour
 
IRJET- E-Gatepass System
IRJET- E-Gatepass SystemIRJET- E-Gatepass System
IRJET- E-Gatepass SystemIRJET Journal
 
Departure Delay Prediction using Machine Learning.
Departure Delay Prediction using Machine Learning.Departure Delay Prediction using Machine Learning.
Departure Delay Prediction using Machine Learning.IRJET Journal
 
Application resilience: challenges and good practice
Application resilience: challenges and good practiceApplication resilience: challenges and good practice
Application resilience: challenges and good practicealedsage
 

Similar to From Modeling to Code Generation in UML (20)

Process Quality Management, Human Resources, Quality Assurance
Process Quality Management, Human Resources, QualityAssuranceProcess Quality Management, Human Resources, QualityAssurance
Process Quality Management, Human Resources, Quality Assurance
 
Approaches to Software Development
Approaches to Software DevelopmentApproaches to Software Development
Approaches to Software Development
 
Reactive applications tools of the trade huff po
Reactive applications   tools of the trade huff poReactive applications   tools of the trade huff po
Reactive applications tools of the trade huff po
 
"Concurrent React 18. "I might do it later"", Mykola Yenin
"Concurrent React 18. "I might do it later"", Mykola Yenin "Concurrent React 18. "I might do it later"", Mykola Yenin
"Concurrent React 18. "I might do it later"", Mykola Yenin
 
SRE - drupal day aveiro 2016
SRE - drupal day aveiro 2016SRE - drupal day aveiro 2016
SRE - drupal day aveiro 2016
 
What is the Next Generation for Application Managed Services?
What is the Next Generation for Application Managed Services?What is the Next Generation for Application Managed Services?
What is the Next Generation for Application Managed Services?
 
Business Utility Application
Business Utility ApplicationBusiness Utility Application
Business Utility Application
 
Model based testing
Model based testingModel based testing
Model based testing
 
Accelerate Application Migration - August 5, 2020
Accelerate Application Migration - August 5, 2020Accelerate Application Migration - August 5, 2020
Accelerate Application Migration - August 5, 2020
 
Which is better asp.net mvc vs asp.net
Which is better  asp.net mvc vs asp.netWhich is better  asp.net mvc vs asp.net
Which is better asp.net mvc vs asp.net
 
Enterprise SCADA Standardization - Nov 2010 - Digital Oilfield.PDF
Enterprise SCADA Standardization - Nov 2010 - Digital Oilfield.PDFEnterprise SCADA Standardization - Nov 2010 - Digital Oilfield.PDF
Enterprise SCADA Standardization - Nov 2010 - Digital Oilfield.PDF
 
Product Quality: Metrics, Verification, Validation, Testing
Product Quality: Metrics, Verification, Validation, TestingProduct Quality: Metrics, Verification, Validation, Testing
Product Quality: Metrics, Verification, Validation, Testing
 
MVC
MVCMVC
MVC
 
What are Software Testing Methodologies | Software Testing Techniques | Edureka
What are Software Testing Methodologies | Software Testing Techniques | EdurekaWhat are Software Testing Methodologies | Software Testing Techniques | Edureka
What are Software Testing Methodologies | Software Testing Techniques | Edureka
 
Memory Management in Trading Platforms
Memory Management in Trading PlatformsMemory Management in Trading Platforms
Memory Management in Trading Platforms
 
Performance Testing
Performance TestingPerformance Testing
Performance Testing
 
Best Practices & Lessons Learned from the field on EMC Documentum xCP 2.0
Best Practices & Lessons Learned from the field on EMC Documentum xCP 2.0Best Practices & Lessons Learned from the field on EMC Documentum xCP 2.0
Best Practices & Lessons Learned from the field on EMC Documentum xCP 2.0
 
IRJET- E-Gatepass System
IRJET- E-Gatepass SystemIRJET- E-Gatepass System
IRJET- E-Gatepass System
 
Departure Delay Prediction using Machine Learning.
Departure Delay Prediction using Machine Learning.Departure Delay Prediction using Machine Learning.
Departure Delay Prediction using Machine Learning.
 
Application resilience: challenges and good practice
Application resilience: challenges and good practiceApplication resilience: challenges and good practice
Application resilience: challenges and good practice
 

More from Reem Alattas

Rumble Lights Pitch Deck
Rumble Lights Pitch DeckRumble Lights Pitch Deck
Rumble Lights Pitch DeckReem Alattas
 
NASA Datanauts Water Cooler Chat: Autonomous Design of Modular Robots
NASA Datanauts Water Cooler Chat: Autonomous Design of Modular RobotsNASA Datanauts Water Cooler Chat: Autonomous Design of Modular Robots
NASA Datanauts Water Cooler Chat: Autonomous Design of Modular RobotsReem Alattas
 
She looks just like me 2017
She looks just like me 2017She looks just like me 2017
She looks just like me 2017Reem Alattas
 
Nasa Datanauts Water Cooler Chat: Robotics for Space Exploration
Nasa Datanauts Water Cooler Chat: Robotics for Space ExplorationNasa Datanauts Water Cooler Chat: Robotics for Space Exploration
Nasa Datanauts Water Cooler Chat: Robotics for Space ExplorationReem Alattas
 
Nasa Datanauts Water Cooler Chat: Evolutionary Robots for Space Exploration
Nasa Datanauts Water Cooler Chat: Evolutionary Robots for Space ExplorationNasa Datanauts Water Cooler Chat: Evolutionary Robots for Space Exploration
Nasa Datanauts Water Cooler Chat: Evolutionary Robots for Space ExplorationReem Alattas
 
She Looks Just Like Me 2017
She Looks Just Like Me 2017She Looks Just Like Me 2017
She Looks Just Like Me 2017Reem Alattas
 
Evolutionary Algorithms
Evolutionary AlgorithmsEvolutionary Algorithms
Evolutionary AlgorithmsReem Alattas
 
Evolutionary Robotics
Evolutionary RoboticsEvolutionary Robotics
Evolutionary RoboticsReem Alattas
 
Enhancing input on and above the interactive surface
Enhancing input on and above the interactive surfaceEnhancing input on and above the interactive surface
Enhancing input on and above the interactive surfaceReem Alattas
 
Skinput: Appropriating the Body as an Input Surface
Skinput: Appropriating the Body as an Input SurfaceSkinput: Appropriating the Body as an Input Surface
Skinput: Appropriating the Body as an Input SurfaceReem Alattas
 
XML - EXtensible Markup Language
XML - EXtensible Markup LanguageXML - EXtensible Markup Language
XML - EXtensible Markup LanguageReem Alattas
 
Dynamic HTML Event Model
Dynamic HTML Event ModelDynamic HTML Event Model
Dynamic HTML Event ModelReem Alattas
 
DHTML - Dynamic HTML
DHTML - Dynamic HTMLDHTML - Dynamic HTML
DHTML - Dynamic HTMLReem Alattas
 
JavaScript Objects
JavaScript ObjectsJavaScript Objects
JavaScript ObjectsReem Alattas
 
Linear Search & Binary Search
Linear Search & Binary SearchLinear Search & Binary Search
Linear Search & Binary SearchReem Alattas
 
JavaScript Arrays
JavaScript Arrays JavaScript Arrays
JavaScript Arrays Reem Alattas
 
JavaScript Functions
JavaScript Functions JavaScript Functions
JavaScript Functions Reem Alattas
 

More from Reem Alattas (20)

Rumble Lights Pitch Deck
Rumble Lights Pitch DeckRumble Lights Pitch Deck
Rumble Lights Pitch Deck
 
NASA Datanauts Water Cooler Chat: Autonomous Design of Modular Robots
NASA Datanauts Water Cooler Chat: Autonomous Design of Modular RobotsNASA Datanauts Water Cooler Chat: Autonomous Design of Modular Robots
NASA Datanauts Water Cooler Chat: Autonomous Design of Modular Robots
 
She looks just like me 2017
She looks just like me 2017She looks just like me 2017
She looks just like me 2017
 
Nasa Datanauts Water Cooler Chat: Robotics for Space Exploration
Nasa Datanauts Water Cooler Chat: Robotics for Space ExplorationNasa Datanauts Water Cooler Chat: Robotics for Space Exploration
Nasa Datanauts Water Cooler Chat: Robotics for Space Exploration
 
Nasa Datanauts Water Cooler Chat: Evolutionary Robots for Space Exploration
Nasa Datanauts Water Cooler Chat: Evolutionary Robots for Space ExplorationNasa Datanauts Water Cooler Chat: Evolutionary Robots for Space Exploration
Nasa Datanauts Water Cooler Chat: Evolutionary Robots for Space Exploration
 
She Looks Just Like Me 2017
She Looks Just Like Me 2017She Looks Just Like Me 2017
She Looks Just Like Me 2017
 
Tran helmet pitch
Tran helmet pitchTran helmet pitch
Tran helmet pitch
 
Evolutionary Algorithms
Evolutionary AlgorithmsEvolutionary Algorithms
Evolutionary Algorithms
 
Evolutionary Robotics
Evolutionary RoboticsEvolutionary Robotics
Evolutionary Robotics
 
Create a Need
Create a NeedCreate a Need
Create a Need
 
Enhancing input on and above the interactive surface
Enhancing input on and above the interactive surfaceEnhancing input on and above the interactive surface
Enhancing input on and above the interactive surface
 
Skinput: Appropriating the Body as an Input Surface
Skinput: Appropriating the Body as an Input SurfaceSkinput: Appropriating the Body as an Input Surface
Skinput: Appropriating the Body as an Input Surface
 
XML - EXtensible Markup Language
XML - EXtensible Markup LanguageXML - EXtensible Markup Language
XML - EXtensible Markup Language
 
Dynamic HTML Event Model
Dynamic HTML Event ModelDynamic HTML Event Model
Dynamic HTML Event Model
 
PHP Scripting
PHP ScriptingPHP Scripting
PHP Scripting
 
DHTML - Dynamic HTML
DHTML - Dynamic HTMLDHTML - Dynamic HTML
DHTML - Dynamic HTML
 
JavaScript Objects
JavaScript ObjectsJavaScript Objects
JavaScript Objects
 
Linear Search & Binary Search
Linear Search & Binary SearchLinear Search & Binary Search
Linear Search & Binary Search
 
JavaScript Arrays
JavaScript Arrays JavaScript Arrays
JavaScript Arrays
 
JavaScript Functions
JavaScript Functions JavaScript Functions
JavaScript Functions
 

Recently uploaded

SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfakmcokerachita
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 

Recently uploaded (20)

SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdf
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 

From Modeling to Code Generation in UML

  • 1. Arab Open University 2nd Semester, 2006-2007 M301 Unit 5.1 From Model to Implementation reem.attas@arabou.org.sa
  • 2. Reem AlAttas © 2 Topic Road Map  Moving towards Implementation From Requirements to Code Controlling Inheritance Using Tools to Automate Development Modeling Implementation and Deployment
  • 3. Reem AlAttas © 3 When do you stop modeling? When it is easier to construct code than building more models.
  • 4. Reem AlAttas © 4 Using activity diagrams for operations Activity diagrams:  Show the flow of control from one activity to another.  Used to investigate the different scenarios in a use case.  Show the steps required to collect the set of rules governing an operation.
  • 5. Reem AlAttas © 5 Class model shows payments made against a hotel bill
  • 6. Reem AlAttas © 6 A set of rules for payment authorization  The hotel need to authorize a payment by cheque or credit card.
  • 7. Reem AlAttas © 7 Sequence diagrams Used to illustrate the possible scenarios for performing a use case.
  • 8. Reem AlAttas © 8 An example of cheque authorization  One of the hotel’s managers, John, has authorized a cheque, p101, for payment against a bill, b99.
  • 9. Reem AlAttas © 9 Topic Road Map Moving towards Implementation  From Requirements to Code Controlling Inheritance Using Tools to Automate Development Modeling Implementation and Deployment
  • 10. Reem AlAttas © 10 From requirements to implementation Pre- and post-conditions were recoded in natural language. If you want to incorporate them into Java code as executable statements, you will need to express them in the Java language.
  • 11. Reem AlAttas © 11 Assertion A statement that can be true or false in a similar way that a Boolean expression will be either true or false in Java.
  • 12. Reem AlAttas © 12 An ‘extended’ Java syntax for an assertion handling  @pre indicates the value of the expression when the method started its execution.
  • 13. Reem AlAttas © 13 The absence of pre- or post- conditions  This does not mean that no pre-condition applies: it is simply a way of saying that the pre- condition is true.
  • 14. Reem AlAttas © 14 Not all assertions are easy to express in a programming language If it is not possible to express an assertion formally (in a programming language) it is good practice to include it informally (in natural language). This can be done by including its natural language version as a comment in the appropriate pre, post or invariant clause.
  • 15. Reem AlAttas © 15 … Not all assertions are easy to express in a programming language
  • 16. Reem AlAttas © 16 Invariants and their relationship to pre- and post-conditions  The invariant is considered as part of both the pre- and the post-conditions.  Before a method can be executed both the invariant and the pre-condition must hold.  After the method has completed, the invariant and the post-condition must hold.
  • 17. Reem AlAttas © 17 The supplier code  The implementation (code) of a method.
  • 18. Reem AlAttas © 18 The client code  How to call the method?  Suppose that acct1 is an object of type BankAccount.
  • 19. Reem AlAttas © 19 Monitoring assertions
  • 20. Reem AlAttas © 20 Topic Road Map Moving towards Implementation From Requirements to Code  Controlling Inheritance Using Tools to Automate Development Modeling Implementation and Deployment
  • 21. Reem AlAttas © 21 Forms of Inheritance Inheritance for  Specialization.  Specification.  Construction.
  • 22. Reem AlAttas © 22 Inheritance without redefinition of methods  Since SavingsAccount and SpecialSavingsAccount are related via generalization, it means that an object of class SpecialSavingsAccount is-a object of class SavingsAccount.
  • 23. Reem AlAttas © 23 … Inheritance without redefinition of methods The methods that SpecialSavingsAccount inherits from SavingsAccount have the same contracts as those in SavingsAccount. Inheritance without redefinition guarantees that this will be the case.
  • 24. Reem AlAttas © 24 Inheritance with redefinition  Redefined methods automatically inherit the pre- and post-conditions of their parent methods.  Any invariant clause of the parent class should also be inherited by the child class. addInterest ()
  • 25. Reem AlAttas © 25 Topic Road Map Moving towards Implementation From Requirements to Code Controlling Inheritance  Using Tools to Automate Development Modeling Implementation and Deployment
  • 26. Reem AlAttas © 26 Definitions  Engineering: generic term often used to describe the building of an artifact (e.g. software, car, rocket) from some kind of model.  Forward engineering: is a synonym for the engineering process that is often used in CASE tools.  Code generation: the normal forward engineering process which automatically generates code.
  • 27. Reem AlAttas © 27 ... Definitions Reverse engineering: is the derivation of a model from an artifact (which, in the case of S/W engineering is usually source code).
  • 28. Reem AlAttas © 28 ... Definitions  Round-trip engineering: going from model to code and back again (perhaps repeatedly) to ensure the consistency between model and code.  Simultaneous round-trip engineering: edit code or model and have the other updated automatically.
  • 29. Reem AlAttas © 29 Topic Road Map Moving towards Implementation From Requirements to Code Controlling Inheritance Using Tools to Automate Development  Modeling Implementation and Deployment
  • 30. Reem AlAttas © 30 Nodes (processing resources) Run-time, physical objects which have at least a memory and often processing capability as well. Nodes include:  computing devices.  human resources.  mechanical processing resources.
  • 31. Reem AlAttas © 31 Real-world constraint on how a system may be built and maintained  The current capabilities of the technology and probably the budget of the customer.  Non-functional requirements, such as response time or robustness, cannot be modeled.  The programming language and the environment in which it is coded and documented.
  • 32. Reem AlAttas © 32 Component Any distributable part of a system, which might include executable software, source code for the software, user manuals or documentation, or even a specialized piece of hardware. If an object can be touched, or stored on a medium that can be touched, then it can be a component.
  • 33. Reem AlAttas © 33 Component Symbol
  • 34. Reem AlAttas © 34 A simple component diagram showing a dependency class
  • 35. Reem AlAttas © 35 Simple Java program & its corresponding component diagram
  • 36. Reem AlAttas © 36 Deployment diagram  Indicates only the components that are active at run-time.
  • 37. Reem AlAttas © 37 Deployment diagram for home banking
  • 38. Reem AlAttas © 38 Packages class