SlideShare a Scribd company logo
1 of 27
Object-Oriented Analysis and Design Using UML
Objectives


                In this session, you will learn to:
                   Identify various types of classes and the relationships between
                   them
                   Identify interfaces




     Ver. 1.0                                                             Slide 1 of 27
Object-Oriented Analysis and Design Using UML
Identifying Types of Classes and Relationships between Classes


                After you identify the classes from the problem statement or
                use cases, you can classify the identified classes into
                various types.
                This enables you to make the software system reusable and
                manageable.




     Ver. 1.0                                                       Slide 2 of 27
Object-Oriented Analysis and Design Using UML
Types of Classes


                UML classifies classes into the following categories:
                   Abstract class
                   Parameterized class
                   Factory class
                   Self-linked class




     Ver. 1.0                                                           Slide 3 of 27
Object-Oriented Analysis and Design Using UML
Types of Classes (Contd.)


                Abstract class:
                   An abstract class is a class that does not have any direct
                   instances.
                   The classes inherited from an abstract class can have direct
                   instances.
                   An abstract class is used to define the common features and
                   common behavior of a set of subclasses.
                   The UML notation for an abstract class is same as that of a
                   simple class. However, the name of the class is italicized to
                   indicate that the class is an abstract class.




     Ver. 1.0                                                             Slide 4 of 27
Object-Oriented Analysis and Design Using UML
Types of Classes (Contd.)


                Parameterized Class:
                   A parameterized class provides a mechanism that enables you
                   to use operations and classes to work with different data types.
                   A parameterized class consists of type parameters that are
                   unbounded.
                   The data types of the parameters are not defined in the
                   parameterized class.
                   You cannot create the objects of a parameterized class.
                   To use the functions defined in the parameterized class, you
                   need to realize the parameterized class by using classes.
                   The data types of the type parameters are defined in the
                   classes that realize the parameterized class.




     Ver. 1.0                                                              Slide 5 of 27
Object-Oriented Analysis and Design Using UML
Types of Classes (Contd.)


                The following is the representation of a parameterized
                class.
                                              ElementType: T

                                     List


                         Add (T)




     Ver. 1.0                                                        Slide 6 of 27
Object-Oriented Analysis and Design Using UML
Types of Classes (Contd.)


                Factory Class:
                   A class whose multiple objects have same attribute values is
                   known as a factory class.
                   An example of a factory class is an EJB factory class that
                   creates multiple instances of EJB in an instance pool of the
                   J2EE middle tier server.
                   You can represent the multiple objects of a factory class by
                   single symbol of overlapping rectangles.
                   The following is the representation of a factory class.



                         ObjectName : ClassName



     Ver. 1.0                                                            Slide 7 of 27
Object-Oriented Analysis and Design Using UML
Types of Classes (Contd.)


                Self-Linked Class:
                   A class whose objects fulfill more than one role is called a self-
                   linked class.
                   The following is the representation of a self-linked class.




     Ver. 1.0                                                                Slide 8 of 27
Object-Oriented Analysis and Design Using UML
Recursive Aggregation and Qualified Association Relationships


                Recursive Aggregation:
                   Is an association relationship between two objects of the same
                   class.
                   The following figure shows the recursive aggregation
                   relationship between the ProjectManager and Developer
                   objects of the Employee class.




     Ver. 1.0                                                            Slide 9 of 27
Object-Oriented Analysis and Design Using UML
Recursive Aggregation and Qualified Association Relationships (Contd.)


                The following figure shows recursive aggregation in a class
                diagram.




     Ver. 1.0                                                       Slide 10 of 27
Object-Oriented Analysis and Design Using UML
Recursive Aggregation and Qualified Association Relationships (Contd.)


                Qualified Association:
                   An association relationship that relates an object of a class to a
                   particular object or a set of objects of another class.
                   A qualifier is used to distinguish the objects of one class from
                   another. A qualifier can be an attribute of the class.
                   The following figure depicts a qualified association between the
                   University class and the Student class.




     Ver. 1.0                                                               Slide 11 of 27
Object-Oriented Analysis and Design Using UML
Derived Elements


                •   Can be derived from one or more elements of the same
                    type.
                •   Can be used to model an explicit detailed design.
                •   Are represented in a class diagram by placing a slash (/)
                    before the name of an element.
                •   Are of two types:
                       Derived attribute
                       Derived association




     Ver. 1.0                                                            Slide 12 of 27
Object-Oriented Analysis and Design Using UML
Derived Elements (Contd.)


                Derived Attribute:
                   The value of a derived attribute is calculated from the value of
                   other attributes of the object.
                   The formula for calculating the derived attribute is represented
                   as a constraint in the class diagram.
                   Representation of a derived attribute in UML notation is as
                   follows:




     Ver. 1.0                                                              Slide 13 of 27
Object-Oriented Analysis and Design Using UML
Derived Association


                Derived Association:
                 – A derived association can be deduced from other associations
                   in a class diagram.
                 – Representation of a derived association in UML notation:




     Ver. 1.0                                                           Slide 14 of 27
Object-Oriented Analysis and Design Using UML
Just a minute


                Which of the following is an association relationship
                between two objects of the same class?
                 1.   Recursive aggregation
                 2.   Derived association
                 3.   Qualified association
                 4.   Derived attribute




                Answer:
                      Recursive aggregation


     Ver. 1.0                                                           Slide 15 of 27
Object-Oriented Analysis and Design Using UML
Identifying Interfaces


                An interface is a collection of operations that are used to
                represent the services provided by a class or component.
                An interface provides the declaration of only the public
                methods and does not provide their implementation.
                You cannot create objects of interfaces.




     Ver. 1.0                                                         Slide 16 of 27
Object-Oriented Analysis and Design Using UML
Creating Interfaces


                In UML, an interface is represented as a circle. Each
                interface has a unique name that is prefixed with the name
                of the package in which it is contained.
                The following figure shows an interface with the package
                name.




     Ver. 1.0                                                       Slide 17 of 27
Object-Oriented Analysis and Design Using UML
Creating Interfaces (Contd.)


                UML provides two notations for representing interfaces:
                 – You can represent an interface as a circle.
                 – You can also represent an interface in the class notation,
                   which contains the interface name preceded with the keyword,
                   <<interface>>, and the methods declarations.
                It is a good practice to prefix the name of an interface with,
                I, to distinguish it from other elements, such as classes.
                Multiple classes or components can realize interfaces to
                provide the functions specified in the interfaces.




     Ver. 1.0                                                          Slide 18 of 27
Object-Oriented Analysis and Design Using UML
Creating Interfaces (Contd.)


                Multiple classes or components can realize interfaces to
                provide the functions specified in the interfaces.
                UML provides two notations to realize an interface:
                   Lollipop notation:




     Ver. 1.0                                                       Slide 19 of 27
Object-Oriented Analysis and Design Using UML
Creating Interfaces (Contd.)


                Dashed arrow notation:




     Ver. 1.0                                   Slide 20 of 27
Object-Oriented Analysis and Design Using UML
Differentiating Abstract Classes from Interfaces


                Abstract class and interfaces both provide the specification
                of methods but do not allow you to create instances directly.
                The implementations of the methods specified in the
                abstract classes and interfaces are provided in the derived
                classes.
                Dissimilarities between an abstract class and an interface
                are:
                   Interfaces enable you to implement multiple inheritance
                   because a class can implement more than one interfaces.
                   However, abstract classes do not support multiple inheritance.
                   A class cannot inherit more than one abstract class.
                   An abstract class contains attributes and methods, which can
                   be public, private, or protected. An interface consists of only
                   methods.


     Ver. 1.0                                                             Slide 21 of 27
Object-Oriented Analysis and Design Using UML
Differentiating Abstract Classes from Interfaces (Contd.)


                An abstract class may provide the definition of some of its
                methods but interfaces do not provide any definitions.
                An abstract class is used in the same package where as an
                interface can be realized across multiple packages.




     Ver. 1.0                                                         Slide 22 of 27
Object-Oriented Analysis and Design Using UML
Demo: Modeling the Static View of the Bank ATM System


                Problem Statement:
                   Janes Technology has been assigned the task of creating a
                   prototype for the InfoSuper bank ATM system. The project
                   manager of Janes Technology has created the following use
                   case diagram for the prototype after gathering requirements
                   from InfoSuper bank:




     Ver. 1.0                                                           Slide 23 of 27
Object-Oriented Analysis and Design Using UML
Demo: Modeling the Static View of the Bank ATM System (Contd.)


                The use case diagram depicts that the customers of the
                InfoSuper bank can have savings and current accounts. The
                ATM system allows the customers to withdraw cash after the
                ATM card and PIN of the customers is validated. The ATM
                system also enables the customers to change PIN and obtain a
                transaction summary.
                To model the static view of the prototype, the project manager
                needs to create the following diagrams:
                 – Class diagram
                 – Object diagram




     Ver. 1.0                                                        Slide 24 of 27
Object-Oriented Analysis and Design Using UML
Demo: Modeling the Static View of the Bank ATM System (Contd.)


                Solution:
                   To model the static view of prototype of the InfoSuper bank
                   ATM system, you need to perform the following tasks:
                      Identify the classes for the prototype.
                      Identify the attributes and their visibility.
                      Identify the operations and their visibility.
                      Identify the relationships among classes.
                      Identify interfaces and their realization relationships.
                      Create a Class diagram.
                      Create an Object diagram.




     Ver. 1.0                                                                    Slide 25 of 27
Object-Oriented Analysis and Design Using UML
Summary


               In this session, you learned that:
                  An abstract class is a class that does not have any direct
                  instances.
                  An abstract class is used to define the common features and
                  common behavior of a set of subclasses.
                  A parameterized class, also called template class, provides a
                  mechanism that enables you to use operations and classes to
                  work with different data types.
                  The objects of a parameterized class cannot be created.
                  A class that has multiple objects having the same attribute
                  values is known as a factory class.
                  A class that has objects, which fulfill more than one role, is
                  called a self-linked class.




    Ver. 1.0                                                             Slide 26 of 27
Object-Oriented Analysis and Design Using UML
Summary (Contd.)


               In addition to generalization, dependency, and association
               relationships, you can also represent the following relationships
               among classes and objects:
                   Recursive aggregation
                   Qualified association
               A derived element can be derived from one or more other
               elements of the same type.
               An interface is defined as a collection of operations that
               specifies a particular service of a class or a component.




    Ver. 1.0                                                           Slide 27 of 27

More Related Content

What's hot

12 ooad uml-16
12 ooad uml-1612 ooad uml-16
12 ooad uml-16Niit Care
 
10 ooad uml-13
10 ooad uml-1310 ooad uml-13
10 ooad uml-13Niit Care
 
Object-Oriented Application Frameworks
Object-Oriented Application FrameworksObject-Oriented Application Frameworks
Object-Oriented Application Frameworkskim.mens
 
08 ooad uml-10
08 ooad uml-1008 ooad uml-10
08 ooad uml-10Niit Care
 
OO Development 3 - Models And UML
OO Development 3 - Models And UMLOO Development 3 - Models And UML
OO Development 3 - Models And UMLRandy Connolly
 
Uml Explained Step ByStep
Uml Explained Step ByStepUml Explained Step ByStep
Uml Explained Step ByStepWaseem Khan
 
Lab # 06
Lab # 06Lab # 06
Lab # 06Mr SMAK
 
UNIFIED MODELING LANGUAGE
UNIFIED MODELING LANGUAGEUNIFIED MODELING LANGUAGE
UNIFIED MODELING LANGUAGERaval Chirag
 
What is UML (Unified Modeling Language)?
What is UML (Unified Modeling Language)?What is UML (Unified Modeling Language)?
What is UML (Unified Modeling Language)?Eliza Wright
 
A&D - Object Oriented Analysis using UML
A&D - Object Oriented Analysis using UMLA&D - Object Oriented Analysis using UML
A&D - Object Oriented Analysis using UMLvinay arora
 
Function oriented design
Function oriented designFunction oriented design
Function oriented designVidhun T
 
OO Development 5 - Analysis
OO Development 5 - AnalysisOO Development 5 - Analysis
OO Development 5 - AnalysisRandy Connolly
 
Uml Presentation
Uml PresentationUml Presentation
Uml Presentationanasz3z3
 

What's hot (19)

12 ooad uml-16
12 ooad uml-1612 ooad uml-16
12 ooad uml-16
 
10 ooad uml-13
10 ooad uml-1310 ooad uml-13
10 ooad uml-13
 
Object-Oriented Application Frameworks
Object-Oriented Application FrameworksObject-Oriented Application Frameworks
Object-Oriented Application Frameworks
 
08 ooad uml-10
08 ooad uml-1008 ooad uml-10
08 ooad uml-10
 
Unified Modeling Language
Unified Modeling LanguageUnified Modeling Language
Unified Modeling Language
 
UML
UMLUML
UML
 
OO Development 3 - Models And UML
OO Development 3 - Models And UMLOO Development 3 - Models And UML
OO Development 3 - Models And UML
 
Uml Explained Step ByStep
Uml Explained Step ByStepUml Explained Step ByStep
Uml Explained Step ByStep
 
Unified Modeling Language
Unified Modeling LanguageUnified Modeling Language
Unified Modeling Language
 
Lab # 06
Lab # 06Lab # 06
Lab # 06
 
UNIFIED MODELING LANGUAGE
UNIFIED MODELING LANGUAGEUNIFIED MODELING LANGUAGE
UNIFIED MODELING LANGUAGE
 
What is UML (Unified Modeling Language)?
What is UML (Unified Modeling Language)?What is UML (Unified Modeling Language)?
What is UML (Unified Modeling Language)?
 
Ooad unit 1
Ooad unit 1Ooad unit 1
Ooad unit 1
 
A&D - Object Oriented Analysis using UML
A&D - Object Oriented Analysis using UMLA&D - Object Oriented Analysis using UML
A&D - Object Oriented Analysis using UML
 
Ooad
OoadOoad
Ooad
 
Function oriented design
Function oriented designFunction oriented design
Function oriented design
 
OO Development 5 - Analysis
OO Development 5 - AnalysisOO Development 5 - Analysis
OO Development 5 - Analysis
 
Uml
UmlUml
Uml
 
Uml Presentation
Uml PresentationUml Presentation
Uml Presentation
 

Similar to 07 ooad uml-08

Similar to 07 ooad uml-08 (20)

Understanding unified modelling language
Understanding unified modelling languageUnderstanding unified modelling language
Understanding unified modelling language
 
Uml
Uml Uml
Uml
 
Uml.pptx
Uml.pptxUml.pptx
Uml.pptx
 
Object Oriented Modeling and Design with UML
Object Oriented Modeling and Design with UMLObject Oriented Modeling and Design with UML
Object Oriented Modeling and Design with UML
 
M05 Metamodel
M05 MetamodelM05 Metamodel
M05 Metamodel
 
03 ooad-uml 03
03 ooad-uml 0303 ooad-uml 03
03 ooad-uml 03
 
Class diagram
Class diagramClass diagram
Class diagram
 
Introduction to Modeling Java and UML
Introduction to Modeling Java and UMLIntroduction to Modeling Java and UML
Introduction to Modeling Java and UML
 
Oop09 6
Oop09 6Oop09 6
Oop09 6
 
Domain object model
Domain object modelDomain object model
Domain object model
 
Lecture 4
Lecture 4Lecture 4
Lecture 4
 
OOP_Module 2.pptx
OOP_Module 2.pptxOOP_Module 2.pptx
OOP_Module 2.pptx
 
Architecture and design
Architecture and designArchitecture and design
Architecture and design
 
Ooad lab manual
Ooad  lab manualOoad  lab manual
Ooad lab manual
 
CS8592 Object Oriented Analysis & Design - UNIT II
CS8592 Object Oriented Analysis & Design - UNIT IICS8592 Object Oriented Analysis & Design - UNIT II
CS8592 Object Oriented Analysis & Design - UNIT II
 
Object Oriented Database
Object Oriented DatabaseObject Oriented Database
Object Oriented Database
 
Object-oriented modeling and design.pdf
Object-oriented modeling and  design.pdfObject-oriented modeling and  design.pdf
Object-oriented modeling and design.pdf
 
432
432432
432
 
Object diagram
Object diagramObject diagram
Object diagram
 
Intro Uml
Intro UmlIntro Uml
Intro Uml
 

More from Niit Care (20)

Ajs 1 b
Ajs 1 bAjs 1 b
Ajs 1 b
 
Ajs 4 b
Ajs 4 bAjs 4 b
Ajs 4 b
 
Ajs 4 a
Ajs 4 aAjs 4 a
Ajs 4 a
 
Ajs 4 c
Ajs 4 cAjs 4 c
Ajs 4 c
 
Ajs 3 b
Ajs 3 bAjs 3 b
Ajs 3 b
 
Ajs 3 a
Ajs 3 aAjs 3 a
Ajs 3 a
 
Ajs 3 c
Ajs 3 cAjs 3 c
Ajs 3 c
 
Ajs 2 b
Ajs 2 bAjs 2 b
Ajs 2 b
 
Ajs 2 a
Ajs 2 aAjs 2 a
Ajs 2 a
 
Ajs 2 c
Ajs 2 cAjs 2 c
Ajs 2 c
 
Ajs 1 a
Ajs 1 aAjs 1 a
Ajs 1 a
 
Ajs 1 c
Ajs 1 cAjs 1 c
Ajs 1 c
 
Dacj 4 2-c
Dacj 4 2-cDacj 4 2-c
Dacj 4 2-c
 
Dacj 4 2-b
Dacj 4 2-bDacj 4 2-b
Dacj 4 2-b
 
Dacj 4 2-a
Dacj 4 2-aDacj 4 2-a
Dacj 4 2-a
 
Dacj 4 1-c
Dacj 4 1-cDacj 4 1-c
Dacj 4 1-c
 
Dacj 4 1-b
Dacj 4 1-bDacj 4 1-b
Dacj 4 1-b
 
Dacj 4 1-a
Dacj 4 1-aDacj 4 1-a
Dacj 4 1-a
 
Dacj 1-2 b
Dacj 1-2 bDacj 1-2 b
Dacj 1-2 b
 
Dacj 1-3 c
Dacj 1-3 cDacj 1-3 c
Dacj 1-3 c
 

Recently uploaded

Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Will Schroeder
 
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfUiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfDianaGray10
 
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostKubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostMatt Ray
 
9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding Team9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding TeamAdam Moalla
 
How Accurate are Carbon Emissions Projections?
How Accurate are Carbon Emissions Projections?How Accurate are Carbon Emissions Projections?
How Accurate are Carbon Emissions Projections?IES VE
 
Nanopower In Semiconductor Industry.pdf
Nanopower  In Semiconductor Industry.pdfNanopower  In Semiconductor Industry.pdf
Nanopower In Semiconductor Industry.pdfPedro Manuel
 
Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Commit University
 
COMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a WebsiteCOMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a Websitedgelyza
 
UiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation DevelopersUiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation DevelopersUiPathCommunity
 
Machine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfMachine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfAijun Zhang
 
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationUsing IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationIES VE
 
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPAAnypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPAshyamraj55
 
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDEADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDELiveplex
 
Building AI-Driven Apps Using Semantic Kernel.pptx
Building AI-Driven Apps Using Semantic Kernel.pptxBuilding AI-Driven Apps Using Semantic Kernel.pptx
Building AI-Driven Apps Using Semantic Kernel.pptxUdaiappa Ramachandran
 
UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6DianaGray10
 
Cybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxCybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxGDSC PJATK
 
Designing A Time bound resource download URL
Designing A Time bound resource download URLDesigning A Time bound resource download URL
Designing A Time bound resource download URLRuncy Oommen
 
Empowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintEmpowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintMahmoud Rabie
 

Recently uploaded (20)

201610817 - edge part1
201610817 - edge part1201610817 - edge part1
201610817 - edge part1
 
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
 
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfUiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
 
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostKubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
 
9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding Team9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding Team
 
How Accurate are Carbon Emissions Projections?
How Accurate are Carbon Emissions Projections?How Accurate are Carbon Emissions Projections?
How Accurate are Carbon Emissions Projections?
 
Nanopower In Semiconductor Industry.pdf
Nanopower  In Semiconductor Industry.pdfNanopower  In Semiconductor Industry.pdf
Nanopower In Semiconductor Industry.pdf
 
Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)
 
COMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a WebsiteCOMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a Website
 
UiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation DevelopersUiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation Developers
 
Machine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfMachine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdf
 
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationUsing IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
 
20230104 - machine vision
20230104 - machine vision20230104 - machine vision
20230104 - machine vision
 
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPAAnypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPA
 
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDEADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
 
Building AI-Driven Apps Using Semantic Kernel.pptx
Building AI-Driven Apps Using Semantic Kernel.pptxBuilding AI-Driven Apps Using Semantic Kernel.pptx
Building AI-Driven Apps Using Semantic Kernel.pptx
 
UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6
 
Cybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxCybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptx
 
Designing A Time bound resource download URL
Designing A Time bound resource download URLDesigning A Time bound resource download URL
Designing A Time bound resource download URL
 
Empowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintEmpowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership Blueprint
 

07 ooad uml-08

  • 1. Object-Oriented Analysis and Design Using UML Objectives In this session, you will learn to: Identify various types of classes and the relationships between them Identify interfaces Ver. 1.0 Slide 1 of 27
  • 2. Object-Oriented Analysis and Design Using UML Identifying Types of Classes and Relationships between Classes After you identify the classes from the problem statement or use cases, you can classify the identified classes into various types. This enables you to make the software system reusable and manageable. Ver. 1.0 Slide 2 of 27
  • 3. Object-Oriented Analysis and Design Using UML Types of Classes UML classifies classes into the following categories: Abstract class Parameterized class Factory class Self-linked class Ver. 1.0 Slide 3 of 27
  • 4. Object-Oriented Analysis and Design Using UML Types of Classes (Contd.) Abstract class: An abstract class is a class that does not have any direct instances. The classes inherited from an abstract class can have direct instances. An abstract class is used to define the common features and common behavior of a set of subclasses. The UML notation for an abstract class is same as that of a simple class. However, the name of the class is italicized to indicate that the class is an abstract class. Ver. 1.0 Slide 4 of 27
  • 5. Object-Oriented Analysis and Design Using UML Types of Classes (Contd.) Parameterized Class: A parameterized class provides a mechanism that enables you to use operations and classes to work with different data types. A parameterized class consists of type parameters that are unbounded. The data types of the parameters are not defined in the parameterized class. You cannot create the objects of a parameterized class. To use the functions defined in the parameterized class, you need to realize the parameterized class by using classes. The data types of the type parameters are defined in the classes that realize the parameterized class. Ver. 1.0 Slide 5 of 27
  • 6. Object-Oriented Analysis and Design Using UML Types of Classes (Contd.) The following is the representation of a parameterized class. ElementType: T List Add (T) Ver. 1.0 Slide 6 of 27
  • 7. Object-Oriented Analysis and Design Using UML Types of Classes (Contd.) Factory Class: A class whose multiple objects have same attribute values is known as a factory class. An example of a factory class is an EJB factory class that creates multiple instances of EJB in an instance pool of the J2EE middle tier server. You can represent the multiple objects of a factory class by single symbol of overlapping rectangles. The following is the representation of a factory class. ObjectName : ClassName Ver. 1.0 Slide 7 of 27
  • 8. Object-Oriented Analysis and Design Using UML Types of Classes (Contd.) Self-Linked Class: A class whose objects fulfill more than one role is called a self- linked class. The following is the representation of a self-linked class. Ver. 1.0 Slide 8 of 27
  • 9. Object-Oriented Analysis and Design Using UML Recursive Aggregation and Qualified Association Relationships Recursive Aggregation: Is an association relationship between two objects of the same class. The following figure shows the recursive aggregation relationship between the ProjectManager and Developer objects of the Employee class. Ver. 1.0 Slide 9 of 27
  • 10. Object-Oriented Analysis and Design Using UML Recursive Aggregation and Qualified Association Relationships (Contd.) The following figure shows recursive aggregation in a class diagram. Ver. 1.0 Slide 10 of 27
  • 11. Object-Oriented Analysis and Design Using UML Recursive Aggregation and Qualified Association Relationships (Contd.) Qualified Association: An association relationship that relates an object of a class to a particular object or a set of objects of another class. A qualifier is used to distinguish the objects of one class from another. A qualifier can be an attribute of the class. The following figure depicts a qualified association between the University class and the Student class. Ver. 1.0 Slide 11 of 27
  • 12. Object-Oriented Analysis and Design Using UML Derived Elements • Can be derived from one or more elements of the same type. • Can be used to model an explicit detailed design. • Are represented in a class diagram by placing a slash (/) before the name of an element. • Are of two types: Derived attribute Derived association Ver. 1.0 Slide 12 of 27
  • 13. Object-Oriented Analysis and Design Using UML Derived Elements (Contd.) Derived Attribute: The value of a derived attribute is calculated from the value of other attributes of the object. The formula for calculating the derived attribute is represented as a constraint in the class diagram. Representation of a derived attribute in UML notation is as follows: Ver. 1.0 Slide 13 of 27
  • 14. Object-Oriented Analysis and Design Using UML Derived Association Derived Association: – A derived association can be deduced from other associations in a class diagram. – Representation of a derived association in UML notation: Ver. 1.0 Slide 14 of 27
  • 15. Object-Oriented Analysis and Design Using UML Just a minute Which of the following is an association relationship between two objects of the same class? 1. Recursive aggregation 2. Derived association 3. Qualified association 4. Derived attribute Answer: Recursive aggregation Ver. 1.0 Slide 15 of 27
  • 16. Object-Oriented Analysis and Design Using UML Identifying Interfaces An interface is a collection of operations that are used to represent the services provided by a class or component. An interface provides the declaration of only the public methods and does not provide their implementation. You cannot create objects of interfaces. Ver. 1.0 Slide 16 of 27
  • 17. Object-Oriented Analysis and Design Using UML Creating Interfaces In UML, an interface is represented as a circle. Each interface has a unique name that is prefixed with the name of the package in which it is contained. The following figure shows an interface with the package name. Ver. 1.0 Slide 17 of 27
  • 18. Object-Oriented Analysis and Design Using UML Creating Interfaces (Contd.) UML provides two notations for representing interfaces: – You can represent an interface as a circle. – You can also represent an interface in the class notation, which contains the interface name preceded with the keyword, <<interface>>, and the methods declarations. It is a good practice to prefix the name of an interface with, I, to distinguish it from other elements, such as classes. Multiple classes or components can realize interfaces to provide the functions specified in the interfaces. Ver. 1.0 Slide 18 of 27
  • 19. Object-Oriented Analysis and Design Using UML Creating Interfaces (Contd.) Multiple classes or components can realize interfaces to provide the functions specified in the interfaces. UML provides two notations to realize an interface: Lollipop notation: Ver. 1.0 Slide 19 of 27
  • 20. Object-Oriented Analysis and Design Using UML Creating Interfaces (Contd.) Dashed arrow notation: Ver. 1.0 Slide 20 of 27
  • 21. Object-Oriented Analysis and Design Using UML Differentiating Abstract Classes from Interfaces Abstract class and interfaces both provide the specification of methods but do not allow you to create instances directly. The implementations of the methods specified in the abstract classes and interfaces are provided in the derived classes. Dissimilarities between an abstract class and an interface are: Interfaces enable you to implement multiple inheritance because a class can implement more than one interfaces. However, abstract classes do not support multiple inheritance. A class cannot inherit more than one abstract class. An abstract class contains attributes and methods, which can be public, private, or protected. An interface consists of only methods. Ver. 1.0 Slide 21 of 27
  • 22. Object-Oriented Analysis and Design Using UML Differentiating Abstract Classes from Interfaces (Contd.) An abstract class may provide the definition of some of its methods but interfaces do not provide any definitions. An abstract class is used in the same package where as an interface can be realized across multiple packages. Ver. 1.0 Slide 22 of 27
  • 23. Object-Oriented Analysis and Design Using UML Demo: Modeling the Static View of the Bank ATM System Problem Statement: Janes Technology has been assigned the task of creating a prototype for the InfoSuper bank ATM system. The project manager of Janes Technology has created the following use case diagram for the prototype after gathering requirements from InfoSuper bank: Ver. 1.0 Slide 23 of 27
  • 24. Object-Oriented Analysis and Design Using UML Demo: Modeling the Static View of the Bank ATM System (Contd.) The use case diagram depicts that the customers of the InfoSuper bank can have savings and current accounts. The ATM system allows the customers to withdraw cash after the ATM card and PIN of the customers is validated. The ATM system also enables the customers to change PIN and obtain a transaction summary. To model the static view of the prototype, the project manager needs to create the following diagrams: – Class diagram – Object diagram Ver. 1.0 Slide 24 of 27
  • 25. Object-Oriented Analysis and Design Using UML Demo: Modeling the Static View of the Bank ATM System (Contd.) Solution: To model the static view of prototype of the InfoSuper bank ATM system, you need to perform the following tasks: Identify the classes for the prototype. Identify the attributes and their visibility. Identify the operations and their visibility. Identify the relationships among classes. Identify interfaces and their realization relationships. Create a Class diagram. Create an Object diagram. Ver. 1.0 Slide 25 of 27
  • 26. Object-Oriented Analysis and Design Using UML Summary In this session, you learned that: An abstract class is a class that does not have any direct instances. An abstract class is used to define the common features and common behavior of a set of subclasses. A parameterized class, also called template class, provides a mechanism that enables you to use operations and classes to work with different data types. The objects of a parameterized class cannot be created. A class that has multiple objects having the same attribute values is known as a factory class. A class that has objects, which fulfill more than one role, is called a self-linked class. Ver. 1.0 Slide 26 of 27
  • 27. Object-Oriented Analysis and Design Using UML Summary (Contd.) In addition to generalization, dependency, and association relationships, you can also represent the following relationships among classes and objects: Recursive aggregation Qualified association A derived element can be derived from one or more other elements of the same type. An interface is defined as a collection of operations that specifies a particular service of a class or a component. Ver. 1.0 Slide 27 of 27

Editor's Notes

  1. Initiate the session by explaining the session objectives to the students.
  2. Use the example of the Centralized Sales System for BlueSeas Group given in the student guide to explain Type classes and Implementation classes. Explain that a parameterized class uses formal parameters that are unbounded. This means that the data types of the parameters are not defined in the parameterized class.
  3. Use the example of the Centralized Sales System for BlueSeas Group given in the student guide to explain Type classes and Implementation classes. Explain that a parameterized class uses formal parameters that are unbounded. This means that the data types of the parameters are not defined in the parameterized class.
  4. Use the example of the Centralized Sales System for BlueSeas Group given in the student guide to explain Type classes and Implementation classes. Explain that a parameterized class uses formal parameters that are unbounded. This means that the data types of the parameters are not defined in the parameterized class.
  5. Explain the advantages of using parameterized classes. Explain how parameterized classes work by using the example given in the student guide. Finally, explain the UML notation for a parameterized class.
  6. Explain the advantages of using parameterized classes. Explain how parameterized classes work by using the example given in the student guide. Finally, explain the UML notation for a parameterized class.
  7. Explain the concept of a factory class by using the example given on the slide. Also explain the symbol for a factory class.
  8. Explain the concept of a self-linked class and the notation for a self-linked class.
  9. Explain the concept of recursive aggregation in an object diagram by using the example given on the slide.
  10. Explain recursive aggregation in a class diagram by using the example given on the slide.
  11. Explain the concept of qualified associationby using the example given on the slide.
  12. Explain the concept of derived elements and the two types of derived elements.
  13. Explain the concept of derived attribute by using the example given on the slide.
  14. Explain the concept of derived association by using the example given on the slide.
  15. Check the learning of the students by asking the question given on the slide.
  16. Explain the concept of an interface. Explain the two types of notations for an interface.
  17. Explain how interfaces are realized using classes. Also explain the two notations for realizing an interface, lollipop notation and dashed arrow notation.
  18. Explain the similarities and differences between abstract classes and interfaces.
  19. There are various terms, such as classifiers and enumerations, which are used in modeling languages and in programming languages. Students may come up with these terms and may want to know more about them in the context of UML. You can refer to the following content for information about classifiers and enumerations. Classifier In UML, any element that can have instances, such as classes and interfaces, is known as a classifier. The exceptions to this rule are association and messages that can have instances but do not classify as classifiers. Note that classifiers contain the structural and behavioral features of software systems. Structural features represent the attributes contained in a classifier, and behavioral attributes represent the operation defined in the classifier. Every instance of the classifier shares the same features. The various other types of classifiers in UML are actors, components, data type, node, signal, and use cases. Enumeration An enumeration is a user-defined datatype. It allows you to define and name the datatypes by using its own attributes called literal names. You need to specify the value of the first literal name and the remaining literal names are enumerated starting from the value specified, by default. For example, the datatype, Boolean, contains two attributes, false and true. If you specify the integer value, 0, to false, the literal name, true, automatically takes the value, 1. You can also explicitly specify the value for each literal name. An enumeration is represented as a rectangle with three compartments: The first compartment contains the keyword, &lt;&lt;enumeration&gt;&gt;, before the enumeration name. The second compartment consists of a list of enumerated literal names. The third name consists of a set of defined operations. The following figure shows how to represent an enumeration. &lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;INSERT FIGURE&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
  20. Explain the problem statement given on the slide to the students.
  21. Before starting the demo, you need to copy the required data file from the &lt;&lt;&lt;&lt;&lt;&lt;&lt;PATH&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; folder. The required data file’s name is Bank_ATM.vsd. Demonstrate the solution to the problem statement by following the steps given in the student guide. If you want to show students the final diagram that will be created after performing the demo, you can open the Bank_ATM.vsd file from the &lt;&lt;&lt;&lt;&lt;&lt;&lt;PATH&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; folder. The demo does not repeat similar steps. However, you would be able to complete the diagram with the steps written in the demo. The demo uses Visio to model the static view of the bank ATM system. The demo describes how to model a class, an object, and an interface for the cash withdrawal use case. It outlines the procedure to create the class diagram, such as identification of classes, their attributes, and operations. Similarly, the interface diagram identifies the realization relationship among interfaces.
  22. Summarize the session by using the summary points given in the slide.
  23. Summarize the session by using the summary points given in the slide.