SlideShare uma empresa Scribd logo
1 de 33
Baixar para ler offline
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!

Mais conteúdo relacionado

Mais procurados

Slide 5 Class Diagram
Slide 5 Class DiagramSlide 5 Class Diagram
Slide 5 Class DiagramNiloy Rocker
 
Reusibility vs Extensibility in OOAD
Reusibility vs Extensibility in OOADReusibility vs Extensibility in OOAD
Reusibility vs Extensibility in OOADShivani Kapoor
 
Creational pattern
Creational patternCreational pattern
Creational patternHimanshu
 
Uml class diagram and packages ppt for dot net
Uml class diagram and packages ppt for dot netUml class diagram and packages ppt for dot net
Uml class diagram and packages ppt for dot netmekhap
 
INTRODUCTION TO UML DIAGRAMS
INTRODUCTION TO UML DIAGRAMSINTRODUCTION TO UML DIAGRAMS
INTRODUCTION TO UML DIAGRAMSAshita Agrawal
 
CS8592 Object Oriented Analysis & Design - UNIT I
CS8592 Object Oriented Analysis & Design - UNIT ICS8592 Object Oriented Analysis & Design - UNIT I
CS8592 Object Oriented Analysis & Design - UNIT Ipkaviya
 
Object Modeling Techniques
Object Modeling TechniquesObject Modeling Techniques
Object Modeling TechniquesShilpa Wadhwani
 
Computer graphics(parametric cubic curves)
Computer graphics(parametric cubic curves)Computer graphics(parametric cubic curves)
Computer graphics(parametric cubic curves)Sinthia Sarker
 
Dynamic and Static Modeling
Dynamic and Static ModelingDynamic and Static Modeling
Dynamic and Static ModelingSaurabh Kumar
 
OOAD unit1 introduction to object orientation
 OOAD unit1 introduction to object orientation OOAD unit1 introduction to object orientation
OOAD unit1 introduction to object orientationDr Chetan Shelke
 
Let us understand design pattern
Let us understand design patternLet us understand design pattern
Let us understand design patternMindfire Solutions
 

Mais procurados (20)

Slide 5 Class Diagram
Slide 5 Class DiagramSlide 5 Class Diagram
Slide 5 Class Diagram
 
Ooad
OoadOoad
Ooad
 
Reusibility vs Extensibility in OOAD
Reusibility vs Extensibility in OOADReusibility vs Extensibility in OOAD
Reusibility vs Extensibility in OOAD
 
Creational pattern
Creational patternCreational pattern
Creational pattern
 
Uml class diagram and packages ppt for dot net
Uml class diagram and packages ppt for dot netUml class diagram and packages ppt for dot net
Uml class diagram and packages ppt for dot net
 
INTRODUCTION TO UML DIAGRAMS
INTRODUCTION TO UML DIAGRAMSINTRODUCTION TO UML DIAGRAMS
INTRODUCTION TO UML DIAGRAMS
 
domain model.ppt
domain model.pptdomain model.ppt
domain model.ppt
 
Object modeling
Object modelingObject modeling
Object modeling
 
CS8592-OOAD Lecture Notes Unit-3
CS8592-OOAD Lecture Notes Unit-3CS8592-OOAD Lecture Notes Unit-3
CS8592-OOAD Lecture Notes Unit-3
 
CS8592 Object Oriented Analysis & Design - UNIT I
CS8592 Object Oriented Analysis & Design - UNIT ICS8592 Object Oriented Analysis & Design - UNIT I
CS8592 Object Oriented Analysis & Design - UNIT I
 
Object Modeling Techniques
Object Modeling TechniquesObject Modeling Techniques
Object Modeling Techniques
 
Computer graphics(parametric cubic curves)
Computer graphics(parametric cubic curves)Computer graphics(parametric cubic curves)
Computer graphics(parametric cubic curves)
 
Dynamic and Static Modeling
Dynamic and Static ModelingDynamic and Static Modeling
Dynamic and Static Modeling
 
Class Diagram
Class DiagramClass Diagram
Class Diagram
 
Object Oriented Design
Object Oriented DesignObject Oriented Design
Object Oriented Design
 
Sequence Diagram
Sequence DiagramSequence Diagram
Sequence Diagram
 
OOAD unit1 introduction to object orientation
 OOAD unit1 introduction to object orientation OOAD unit1 introduction to object orientation
OOAD unit1 introduction to object orientation
 
Uml class-diagram
Uml class-diagramUml class-diagram
Uml class-diagram
 
Let us understand design pattern
Let us understand design patternLet us understand design pattern
Let us understand design pattern
 
ANIMATION SEQUENCE
ANIMATION SEQUENCEANIMATION SEQUENCE
ANIMATION SEQUENCE
 

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

Lecture 3 cst205 cst281-oop
Lecture 3 cst205 cst281-oopLecture 3 cst205 cst281-oop
Lecture 3 cst205 cst281-oopktuonlinenotes
 
oomd-unit-i-cgpa.ppt
oomd-unit-i-cgpa.pptoomd-unit-i-cgpa.ppt
oomd-unit-i-cgpa.pptPavan992098
 
Ooad Overview
Ooad OverviewOoad Overview
Ooad OverviewDang Tuan
 
analysis and design with uml
analysis and design with umlanalysis and design with uml
analysis and design with umlsabin kafle
 
CS6502 OOAD - Question Bank and Answer
CS6502 OOAD - Question Bank and AnswerCS6502 OOAD - Question Bank and Answer
CS6502 OOAD - Question Bank and AnswerGobinath Subramaniam
 
Software archiecture lecture03
Software archiecture   lecture03Software archiecture   lecture03
Software archiecture lecture03Luktalja
 
Design and Implementation in Software Engineering
Design and Implementation in Software EngineeringDesign and Implementation in Software Engineering
Design and Implementation in Software EngineeringKourosh Sajjadi
 
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)Dr Sukhpal Singh Gill
 
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.pptxKarthigaiSelviS3
 
Design pattern in android
Design pattern in androidDesign pattern in android
Design pattern in androidJay Kumarr
 
SOLID Principles and The Clean Architecture
SOLID Principles and The Clean ArchitectureSOLID Principles and The Clean Architecture
SOLID Principles and The Clean ArchitectureMohamed Galal
 

Semelhante a 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
 
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
 
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)
 
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
 
SOLID Principles and The Clean Architecture
SOLID Principles and The Clean ArchitectureSOLID Principles and The Clean Architecture
SOLID Principles and The Clean Architecture
 

Mais de Isuru Perera

Java Threads: Lightweight Processes
Java Threads: Lightweight ProcessesJava Threads: Lightweight Processes
Java Threads: Lightweight ProcessesIsuru Perera
 
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 FlamegraphsIsuru Perera
 
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 JavaIsuru Perera
 
Using Flame Graphs
Using Flame GraphsUsing Flame Graphs
Using Flame GraphsIsuru Perera
 
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 RecorderIsuru Perera
 
Java Performance & Profiling
Java Performance & ProfilingJava Performance & Profiling
Java Performance & ProfilingIsuru Perera
 
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 RecorderIsuru Perera
 
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 RecorderIsuru Perera
 
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-10Isuru Perera
 
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 InternalsIsuru Perera
 

Mais 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
 

Último

Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonLeveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonApplitools
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationBradBedford3
 
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full RecordingOpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full RecordingShane Coughlan
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalLionel Briand
 
Ronisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited CatalogueRonisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited Catalogueitservices996
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringHironori Washizaki
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfMarharyta Nedzelska
 
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdfEnhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdfRTS corp
 
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesAmazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesKrzysztofKkol1
 
Patterns for automating API delivery. API conference
Patterns for automating API delivery. API conferencePatterns for automating API delivery. API conference
Patterns for automating API delivery. API conferencessuser9e7c64
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Developmentvyaparkranti
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Cizo Technology Services
 
Not a Kubernetes fan? The state of PaaS in 2024
Not a Kubernetes fan? The state of PaaS in 2024Not a Kubernetes fan? The state of PaaS in 2024
Not a Kubernetes fan? The state of PaaS in 2024Anthony Dahanne
 
Large Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLarge Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLionel Briand
 
Effectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorEffectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorTier1 app
 
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...Bert Jan Schrijver
 
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...OnePlan Solutions
 
What’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 UpdatesWhat’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 UpdatesVictoriaMetrics
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsChristian Birchler
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf31events.com
 

Último (20)

Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonLeveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion Application
 
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full RecordingOpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive Goal
 
Ronisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited CatalogueRonisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited Catalogue
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their Engineering
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdf
 
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdfEnhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
 
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesAmazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
 
Patterns for automating API delivery. API conference
Patterns for automating API delivery. API conferencePatterns for automating API delivery. API conference
Patterns for automating API delivery. API conference
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Development
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
 
Not a Kubernetes fan? The state of PaaS in 2024
Not a Kubernetes fan? The state of PaaS in 2024Not a Kubernetes fan? The state of PaaS in 2024
Not a Kubernetes fan? The state of PaaS in 2024
 
Large Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLarge Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and Repair
 
Effectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorEffectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryError
 
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
 
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
 
What’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 UpdatesWhat’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 Updates
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf
 

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/