SlideShare une entreprise Scribd logo
1  sur  33
Télécharger pour lire hors ligne
Unified Modeling Language (UML),
Object-Oriented Programming
Concepts &
Design Patterns
M. Isuru Tharanga Chrishantha Perera
Associate Technical Lead at WSO2
Co-organizer of Java Colombo Meetup
2
Agenda
● UML
– What is UML?
– Use Case, Activity, Class, Object, Sequence &
State Machine Diagrams
– UML Tools
● OOP Concepts & Principles
● Software Design Principles
● Design Patterns
3
What is UML?
● Unified Modeling Language™ (UML®)
– Object Management Group's (OMG) most-used
specification
– Objective is to "provide system architects,
software engineers, and software developers
with tools for analysis, design, and
implementation of software-based systems as
well as for modeling business and similar
processes"
● UML is a standard modeling language,
not a software development process.
4
UML Versions
● Current version is 2.5 (Released in
2015)
● The first versions of UML were created
by "Three Amigos" (1990s)
– Grady Booch (creator of Booch method)
– Ivar Jacobson (Object-Oriented Software
Engineering, OOSE)
– Jim Rumbaugh (Object-Modeling Technique,
OMT).
5
UML Diagrams
● Structural Modeling Diagrams
– Structure diagrams define the static
architecture of a model.
● Behavioral Modeling Diagrams
– Behavior diagrams capture the varieties of
interaction and instantaneous states within a
model as it 'executes' over time; tracking how
the system will act in a real-world environment,
and observing the effects of an operation or
event, including its results.
6
Structural Modeling Diagrams
● Package Diagrams
● Component Diagrams
● Class or Structural Diagrams
● Deployment Diagrams
● Composite Structure Diagrams
● Object Diagrams
● Profile Diagrams
7
Behavioral Modeling Diagrams
● Use Case Diagrams
● Sequence Diagrams
● Activity Diagrams
● Timing Diagrams
● State Machine Diagrams
● Interaction Overview Diagrams
● Communication Diagrams
8
UML 2.5 Diagrams
9
Use Case Diagrams
● The use case model captures the
requirements of a system.
10
Activity Diagrams
● An activity diagram is used to display
the sequence of activities
11
Class Diagrams
● The class diagram shows the building
blocks of any object-orientated
system.
12
The Entity-Control-Boundary
Pattern
● The ECB Pattern is a variation of the Model-
View-Controller Pattern.
– Entities (model)
●
Objects representing system data, often from the domain model.
– Boundaries (view)
● Objects that interface with system actors (e.g. a user or external
service). Windows, screens and menus are examples of
boundaries that interface with users.
– Controls (controller)
●
Objects that mediate between boundaries and entities. These
serve as the glue between boundary elements and entity
elements, implementing the logic required to manage the
various elements and their interactions.
13
ECB Pattern Rules
● Actors can only talk to boundary
objects.
● Boundary objects can only talk to
controllers and actors.
● Entity objects can only talk to
controllers.
● Controllers can talk to boundary
objects and entity objects, and to
other controllers, but not to actors
14
Object Diagrams
● Object diagrams show how instances
of structural elements are related and
used at run-time.
15
Sequence Diagrams
● Focuses on the sequence of messages
interchanged among lifelines of
objects
16
State Machine Diagrams
● Understanding the instant to instant
condition, or "run state" of a model
when it executes
17
UML Tools
● UMLet
– Free UML Tool for Fast UML Diagrams
– http://www.umlet.com/
● Astah Community
– Another free tool
– http://astah.net/editions/community
– Samples: http://astah.net/fundamentals
18
OOP Concepts
● Object
– An object is a software bundle of related state
and behavior
● Class
– A class is a blueprint or prototype from which
objects are created.
● Inheritance
– Inheritance provides a powerful and natural
mechanism for organizing and structuring your
software.
19
OOP Concepts
● Interface
– An interface is a contract between a class and
the outside world
● Package
– A package is a namespace for organizing
classes and interfaces in a logical manner.
20
OOP Principles
● Polymorphism
– The ability of an object to take on many forms.
– when a parent class reference is used to refer to a child
class object
● Inheritance
– A class is based on another class.
● Encapsulation
– A process of binding or wrapping the data and the codes
that operates on the data into a single entity.
– This keeps the data safe from outside interface and
misuse.
21
Software Design Principles
● A set of guidelines that helps us to avoid having a
bad design.
– The design principles are associated to Robert Martin who
gathered them in "Agile Software Development: Principles,
Patterns, and Practices".
● 3 important characteristics of a bad design
– Rigidity
● It is hard to change because every change affects too many other parts of
the system.
– Fragility
● When you make a change, unexpected parts of the system break.
– Immobility
● It is hard to reuse in another application because it cannot be
disentangled from the current application.
22
Open Close Principle
● Software entities like classes,
modules and functions should be open
for extension but closed for
modifications.
23
Dependency Inversion Principle
● High-level modules should not depend
on low-level modules. Both should
depend on abstractions.
● Abstractions should not depend on
details. Details should depend on
abstractions.
24
Interface Segregation Principle
● Clients should not be forced to
depend upon interfaces that they
don't use.
25
Single Responsibility Principle
● A class should have only one reason
to change.
26
Liskov's Substitution Principle
● Derived types must be completely
substitutable for their base types.
● Liskov's Substitution Principle was
introduced by Barbara Liskov in a
1987 Conference on Object Oriented
Programming Systems Languages and
Applications, in Data abstraction and
hierarchy
27
Design Patterns
● Creational
● Behavioral
● Structural
28
Creational Design Patterns
● Singleton
– Ensure that only one instance of a class is created
– Provide a global access point to the object.
● Factory
– Creates objects without exposing the instantiation logic to the client
– Refers to the newly created object through a common interface
●
Factory Method
– Defines an interface for creating objects, but let subclasses to
decide which class to instantiate
● Abstract Factory
– Offers the interface for creating a family of related objects, without
explicitly specifying their classes.
29
Behavioral Design Patterns
●
Command
– Encapsulate a request in an object, Allows the parameterization of clients with
different requests and Allows saving the requests in a queue.
● Iterator
– Provide a way to access the elements of an aggregate object sequentially without
exposing its underlying representation.
● Observer
– Define a one-to-many dependency between objects so that when one object changes
state, all its dependents are notified and updated automatically.
● Strategy
– Define a family of algorithms, encapsulate each one, and make them interchangeable.
Strategy lets the algorithm vary independently from clients that use it.
● Template Method
– Define the skeleton of an algorithm in an operation, deferring some steps to
subclasses / Template Method lets subclasses redefine certain steps of an algorithm
without letting them to change the algorithm's structure.
30
Structural Design Patterns
● Adapter
– Convert the interface of a class into another
interface clients expect.
● Decorator
– Add additional responsibilities dynamically to
an object.
● Proxy
– Provide a “Placeholder” for an object to control
references to it.
31
Recommended Books
● Head First Design Patterns
● Design Patterns: Elements of
Reusable Object-Oriented Software by
the Gang of Four (GoF)
32
Resources
● UML
– http://www.uml.org/
– http://www.omg.org/spec/UML/Current/
– http://www.sparxsystems.com/resources/uml2_tutorial/index.html
– http://www.uml-diagrams.org
– http://www.agilemodeling.com/essays/umlDiagrams.htm
– http://www.tutorialspoint.com/uml/index.htm
● Java Tutorials
– https://docs.oracle.com/javase/tutorial/index.html
● Object Oriented Design
– http://www.oodesign.com/
● Head First Design Patterns (Sample code available as a zip file)
– http://www.headfirstlabs.com/books/hfdp/
33
Thank you!

Contenu connexe

Tendances

State Machine Diagram
State Machine DiagramState Machine Diagram
State Machine Diagram
Niloy Rocker
 
INTRODUCTION TO UML DIAGRAMS
INTRODUCTION TO UML DIAGRAMSINTRODUCTION TO UML DIAGRAMS
INTRODUCTION TO UML DIAGRAMS
Ashita Agrawal
 
Uml Activity Diagram
Uml Activity DiagramUml Activity Diagram
Uml Activity Diagram
Niloy Rocker
 

Tendances (20)

Diagrams
DiagramsDiagrams
Diagrams
 
UML
UMLUML
UML
 
Introduction to UML
Introduction to UMLIntroduction to UML
Introduction to UML
 
Coupling , Cohesion and there Types
Coupling , Cohesion and there TypesCoupling , Cohesion and there Types
Coupling , Cohesion and there Types
 
State Machine Diagram
State Machine DiagramState Machine Diagram
State Machine Diagram
 
Class diagram- UML diagram
Class diagram- UML diagramClass diagram- UML diagram
Class diagram- UML diagram
 
08 state diagram and activity diagram
08 state diagram and activity diagram08 state diagram and activity diagram
08 state diagram and activity diagram
 
Sequence diagrams
Sequence diagramsSequence diagrams
Sequence diagrams
 
States machine
States machineStates machine
States machine
 
INTRODUCTION TO UML DIAGRAMS
INTRODUCTION TO UML DIAGRAMSINTRODUCTION TO UML DIAGRAMS
INTRODUCTION TO UML DIAGRAMS
 
Dynamic modeling
Dynamic modelingDynamic modeling
Dynamic modeling
 
Object Oriented Programming Concepts
Object Oriented Programming ConceptsObject Oriented Programming Concepts
Object Oriented Programming Concepts
 
Lecture6 activity diagrams
Lecture6 activity diagramsLecture6 activity diagrams
Lecture6 activity diagrams
 
State chart diagram
State chart diagramState chart diagram
State chart diagram
 
Uml Activity Diagram
Uml Activity DiagramUml Activity Diagram
Uml Activity Diagram
 
Object-Oriented Analysis And Design With Applications Grady Booch
Object-Oriented Analysis And Design With Applications Grady BoochObject-Oriented Analysis And Design With Applications Grady Booch
Object-Oriented Analysis And Design With Applications Grady Booch
 
Ooad overview
Ooad overviewOoad overview
Ooad overview
 
CS8592-OOAD Lecture Notes Unit-3
CS8592-OOAD Lecture Notes Unit-3CS8592-OOAD Lecture Notes Unit-3
CS8592-OOAD Lecture Notes Unit-3
 
Behavioural modelling
Behavioural modellingBehavioural modelling
Behavioural modelling
 
Activity diagram
Activity diagramActivity diagram
Activity diagram
 

Similaire à Unified Modeling Language (UML), Object-Oriented Programming Concepts & Design Patterns

Ooad Overview
Ooad OverviewOoad Overview
Ooad Overview
Dang Tuan
 
Object oriented methodologies
Object oriented methodologiesObject oriented methodologies
Object oriented methodologies
naina-rani
 
Software archiecture lecture03
Software archiecture   lecture03Software archiecture   lecture03
Software archiecture lecture03
Luktalja
 
Ch. 3.pdf
Ch. 3.pdfCh. 3.pdf
Ch. 3.pdf
RajniSavaliya
 
Design pattern in android
Design pattern in androidDesign pattern in android
Design pattern in android
Jay Kumarr
 

Similaire à Unified Modeling Language (UML), Object-Oriented Programming Concepts & Design Patterns (20)

UNIT 01 SMD.pptx
UNIT 01 SMD.pptxUNIT 01 SMD.pptx
UNIT 01 SMD.pptx
 
Lecture 3 cst205 cst281-oop
Lecture 3 cst205 cst281-oopLecture 3 cst205 cst281-oop
Lecture 3 cst205 cst281-oop
 
oomd-unit-i-cgpa.ppt
oomd-unit-i-cgpa.pptoomd-unit-i-cgpa.ppt
oomd-unit-i-cgpa.ppt
 
Ooad Overview
Ooad OverviewOoad Overview
Ooad Overview
 
analysis and design with uml
analysis and design with umlanalysis and design with uml
analysis and design with uml
 
Introduction to OOAD
Introduction to OOADIntroduction to OOAD
Introduction to OOAD
 
Chapter1
Chapter1Chapter1
Chapter1
 
CS6502 OOAD - Question Bank and Answer
CS6502 OOAD - Question Bank and AnswerCS6502 OOAD - Question Bank and Answer
CS6502 OOAD - Question Bank and Answer
 
Object oriented methodologies
Object oriented methodologiesObject oriented methodologies
Object oriented methodologies
 
Software archiecture lecture03
Software archiecture   lecture03Software archiecture   lecture03
Software archiecture lecture03
 
Software Engineering CSE/IT.pptx
 Software Engineering CSE/IT.pptx Software Engineering CSE/IT.pptx
Software Engineering CSE/IT.pptx
 
Ch. 3.pdf
Ch. 3.pdfCh. 3.pdf
Ch. 3.pdf
 
Architectural design of software
Architectural  design of softwareArchitectural  design of software
Architectural design of software
 
CS8592-OOAD Lecture Notes Unit-5
CS8592-OOAD Lecture Notes Unit-5 CS8592-OOAD Lecture Notes Unit-5
CS8592-OOAD Lecture Notes Unit-5
 
Bai giang-se-20feb14
Bai giang-se-20feb14Bai giang-se-20feb14
Bai giang-se-20feb14
 
Design and Implementation in Software Engineering
Design and Implementation in Software EngineeringDesign and Implementation in Software Engineering
Design and Implementation in Software Engineering
 
Workshop on Basics of Software Engineering (DFD, UML and Project Culture)
Workshop on Basics of Software Engineering (DFD, UML and Project Culture)Workshop on Basics of Software Engineering (DFD, UML and Project Culture)
Workshop on Basics of Software Engineering (DFD, UML and Project Culture)
 
Software Eng S3 ( Software Design ).pptx
Software Eng S3 ( Software Design ).pptxSoftware Eng S3 ( Software Design ).pptx
Software Eng S3 ( Software Design ).pptx
 
Design Concepts in Software Engineering-1.pptx
Design Concepts in Software Engineering-1.pptxDesign Concepts in Software Engineering-1.pptx
Design Concepts in Software Engineering-1.pptx
 
Design pattern in android
Design pattern in androidDesign pattern in android
Design pattern in android
 

Plus de Isuru Perera

Java in flames
Java in flamesJava in flames
Java in flames
Isuru Perera
 

Plus de Isuru Perera (12)

Java Threads: Lightweight Processes
Java Threads: Lightweight ProcessesJava Threads: Lightweight Processes
Java Threads: Lightweight Processes
 
Software Profiling: Java Performance, Profiling and Flamegraphs
Software Profiling: Java Performance, Profiling and FlamegraphsSoftware Profiling: Java Performance, Profiling and Flamegraphs
Software Profiling: Java Performance, Profiling and Flamegraphs
 
Java in flames
Java in flamesJava in flames
Java in flames
 
Software Profiling: Understanding Java Performance and how to profile in Java
Software Profiling: Understanding Java Performance and how to profile in JavaSoftware Profiling: Understanding Java Performance and how to profile in Java
Software Profiling: Understanding Java Performance and how to profile in Java
 
Using Flame Graphs
Using Flame GraphsUsing Flame Graphs
Using Flame Graphs
 
Java Performance and Using Java Flight Recorder
Java Performance and Using Java Flight RecorderJava Performance and Using Java Flight Recorder
Java Performance and Using Java Flight Recorder
 
Java Performance & Profiling
Java Performance & ProfilingJava Performance & Profiling
Java Performance & Profiling
 
Java Colombo Meetup: Java Mission Control & Java Flight Recorder
Java Colombo Meetup: Java Mission Control & Java Flight RecorderJava Colombo Meetup: Java Mission Control & Java Flight Recorder
Java Colombo Meetup: Java Mission Control & Java Flight Recorder
 
Using Java Mission Control & Java Flight Recorder
Using Java Mission Control & Java Flight RecorderUsing Java Mission Control & Java Flight Recorder
Using Java Mission Control & Java Flight Recorder
 
Building your own PaaS using Apache Stratos - Webinar 2014-04-10
Building your own PaaS using Apache Stratos - Webinar 2014-04-10Building your own PaaS using Apache Stratos - Webinar 2014-04-10
Building your own PaaS using Apache Stratos - Webinar 2014-04-10
 
Apache Stratos (incubating) Hangout IV - Stratos Controller and CLI Internals
Apache Stratos (incubating) Hangout IV - Stratos Controller and CLI InternalsApache Stratos (incubating) Hangout IV - Stratos Controller and CLI Internals
Apache Stratos (incubating) Hangout IV - Stratos Controller and CLI Internals
 
Cloud foundry
Cloud foundryCloud foundry
Cloud foundry
 

Dernier

TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
mohitmore19
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
VishalKumarJha10
 

Dernier (20)

Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 

Unified Modeling Language (UML), Object-Oriented Programming Concepts & Design Patterns

  • 1. Unified Modeling Language (UML), Object-Oriented Programming Concepts & Design Patterns M. Isuru Tharanga Chrishantha Perera Associate Technical Lead at WSO2 Co-organizer of Java Colombo Meetup
  • 2. 2 Agenda ● UML – What is UML? – Use Case, Activity, Class, Object, Sequence & State Machine Diagrams – UML Tools ● OOP Concepts & Principles ● Software Design Principles ● Design Patterns
  • 3. 3 What is UML? ● Unified Modeling Language™ (UML®) – Object Management Group's (OMG) most-used specification – Objective is to "provide system architects, software engineers, and software developers with tools for analysis, design, and implementation of software-based systems as well as for modeling business and similar processes" ● UML is a standard modeling language, not a software development process.
  • 4. 4 UML Versions ● Current version is 2.5 (Released in 2015) ● The first versions of UML were created by "Three Amigos" (1990s) – Grady Booch (creator of Booch method) – Ivar Jacobson (Object-Oriented Software Engineering, OOSE) – Jim Rumbaugh (Object-Modeling Technique, OMT).
  • 5. 5 UML Diagrams ● Structural Modeling Diagrams – Structure diagrams define the static architecture of a model. ● Behavioral Modeling Diagrams – Behavior diagrams capture the varieties of interaction and instantaneous states within a model as it 'executes' over time; tracking how the system will act in a real-world environment, and observing the effects of an operation or event, including its results.
  • 6. 6 Structural Modeling Diagrams ● Package Diagrams ● Component Diagrams ● Class or Structural Diagrams ● Deployment Diagrams ● Composite Structure Diagrams ● Object Diagrams ● Profile Diagrams
  • 7. 7 Behavioral Modeling Diagrams ● Use Case Diagrams ● Sequence Diagrams ● Activity Diagrams ● Timing Diagrams ● State Machine Diagrams ● Interaction Overview Diagrams ● Communication Diagrams
  • 9. 9 Use Case Diagrams ● The use case model captures the requirements of a system.
  • 10. 10 Activity Diagrams ● An activity diagram is used to display the sequence of activities
  • 11. 11 Class Diagrams ● The class diagram shows the building blocks of any object-orientated system.
  • 12. 12 The Entity-Control-Boundary Pattern ● The ECB Pattern is a variation of the Model- View-Controller Pattern. – Entities (model) ● Objects representing system data, often from the domain model. – Boundaries (view) ● Objects that interface with system actors (e.g. a user or external service). Windows, screens and menus are examples of boundaries that interface with users. – Controls (controller) ● Objects that mediate between boundaries and entities. These serve as the glue between boundary elements and entity elements, implementing the logic required to manage the various elements and their interactions.
  • 13. 13 ECB Pattern Rules ● Actors can only talk to boundary objects. ● Boundary objects can only talk to controllers and actors. ● Entity objects can only talk to controllers. ● Controllers can talk to boundary objects and entity objects, and to other controllers, but not to actors
  • 14. 14 Object Diagrams ● Object diagrams show how instances of structural elements are related and used at run-time.
  • 15. 15 Sequence Diagrams ● Focuses on the sequence of messages interchanged among lifelines of objects
  • 16. 16 State Machine Diagrams ● Understanding the instant to instant condition, or "run state" of a model when it executes
  • 17. 17 UML Tools ● UMLet – Free UML Tool for Fast UML Diagrams – http://www.umlet.com/ ● Astah Community – Another free tool – http://astah.net/editions/community – Samples: http://astah.net/fundamentals
  • 18. 18 OOP Concepts ● Object – An object is a software bundle of related state and behavior ● Class – A class is a blueprint or prototype from which objects are created. ● Inheritance – Inheritance provides a powerful and natural mechanism for organizing and structuring your software.
  • 19. 19 OOP Concepts ● Interface – An interface is a contract between a class and the outside world ● Package – A package is a namespace for organizing classes and interfaces in a logical manner.
  • 20. 20 OOP Principles ● Polymorphism – The ability of an object to take on many forms. – when a parent class reference is used to refer to a child class object ● Inheritance – A class is based on another class. ● Encapsulation – A process of binding or wrapping the data and the codes that operates on the data into a single entity. – This keeps the data safe from outside interface and misuse.
  • 21. 21 Software Design Principles ● A set of guidelines that helps us to avoid having a bad design. – The design principles are associated to Robert Martin who gathered them in "Agile Software Development: Principles, Patterns, and Practices". ● 3 important characteristics of a bad design – Rigidity ● It is hard to change because every change affects too many other parts of the system. – Fragility ● When you make a change, unexpected parts of the system break. – Immobility ● It is hard to reuse in another application because it cannot be disentangled from the current application.
  • 22. 22 Open Close Principle ● Software entities like classes, modules and functions should be open for extension but closed for modifications.
  • 23. 23 Dependency Inversion Principle ● High-level modules should not depend on low-level modules. Both should depend on abstractions. ● Abstractions should not depend on details. Details should depend on abstractions.
  • 24. 24 Interface Segregation Principle ● Clients should not be forced to depend upon interfaces that they don't use.
  • 25. 25 Single Responsibility Principle ● A class should have only one reason to change.
  • 26. 26 Liskov's Substitution Principle ● Derived types must be completely substitutable for their base types. ● Liskov's Substitution Principle was introduced by Barbara Liskov in a 1987 Conference on Object Oriented Programming Systems Languages and Applications, in Data abstraction and hierarchy
  • 27. 27 Design Patterns ● Creational ● Behavioral ● Structural
  • 28. 28 Creational Design Patterns ● Singleton – Ensure that only one instance of a class is created – Provide a global access point to the object. ● Factory – Creates objects without exposing the instantiation logic to the client – Refers to the newly created object through a common interface ● Factory Method – Defines an interface for creating objects, but let subclasses to decide which class to instantiate ● Abstract Factory – Offers the interface for creating a family of related objects, without explicitly specifying their classes.
  • 29. 29 Behavioral Design Patterns ● Command – Encapsulate a request in an object, Allows the parameterization of clients with different requests and Allows saving the requests in a queue. ● Iterator – Provide a way to access the elements of an aggregate object sequentially without exposing its underlying representation. ● Observer – Define a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically. ● Strategy – Define a family of algorithms, encapsulate each one, and make them interchangeable. Strategy lets the algorithm vary independently from clients that use it. ● Template Method – Define the skeleton of an algorithm in an operation, deferring some steps to subclasses / Template Method lets subclasses redefine certain steps of an algorithm without letting them to change the algorithm's structure.
  • 30. 30 Structural Design Patterns ● Adapter – Convert the interface of a class into another interface clients expect. ● Decorator – Add additional responsibilities dynamically to an object. ● Proxy – Provide a “Placeholder” for an object to control references to it.
  • 31. 31 Recommended Books ● Head First Design Patterns ● Design Patterns: Elements of Reusable Object-Oriented Software by the Gang of Four (GoF)
  • 32. 32 Resources ● UML – http://www.uml.org/ – http://www.omg.org/spec/UML/Current/ – http://www.sparxsystems.com/resources/uml2_tutorial/index.html – http://www.uml-diagrams.org – http://www.agilemodeling.com/essays/umlDiagrams.htm – http://www.tutorialspoint.com/uml/index.htm ● Java Tutorials – https://docs.oracle.com/javase/tutorial/index.html ● Object Oriented Design – http://www.oodesign.com/ ● Head First Design Patterns (Sample code available as a zip file) – http://www.headfirstlabs.com/books/hfdp/