KEMBAR78
UML Modeling in Java | PPTX
Title Layout
Course: CSE214 (Object Oriented Programming)
Course Teacher: Ms. Rabeya Akhter (RA)
Section: P Depertment: CSE(43 Batch)
Group Members:
01. Md. Ashaf Uddaula (161-15-7473)
02. Alamin Hossain (161-15-7483)
03. Md. Khasrur Rahman (161-15-7214)
04. Md. Eram Talukder (161-15-7485)
05. Ijaz Ahmed Utsa (161-15-7180)
2
What Is Modeling?
• A model is a simplification with a purpose
• Use precisely defined notation to describe and simplify a
complex and interesting structure, phenomenon, or
relationship
• Real-world examples
• The solar system model
• Mathematical models
3
What Is Modeling? (cont’d)
• Simplification
• Less complex, more accessible
• Varying perspectives
• Describe the system from different perspectives
• Help developers manage complexity
• Common notation
• To facilitate communication
• Allows developers to combine their efforts and to work in parallel
4
UML
• Unified Modeling Language
• A language for specifying, visualizing, constructing, and documenting the
artifacts of software systems
• A set of precise notations
• Helps developers create ideas and communicate them
5
UML
The Basics
Abstraction
• A simplification or model of a complex concept, process, or real-world
object
• Help people understand something at an appropriate level
• Different people would build different abstractions for the same
concept
• Highlight the characteristics and behavior of something that is too
complex to understand in its entirety
6
UML
The Basics
Encapsulation
• Highlight the important aspects of an object
• Hide the cumbersome internal details of the object
• Make the system easier to understand and to reuse
• Make a system more extendible
7
UML
The Basics
Union of all Modeling Languages
Use case diagrams
Class diagrams
Object diagrams
Sequence diagrams
Collaboration diagrams
Statechart diagrams
Activity diagrams
Component diagrams
 Deployment diagrams
….
8
UML
The Basics
• Object
• A particular and finite element in a large model
• Visible or invisible
• Persistent or transient
• State: describes characteristics and current condition
• Behavior: defines the actions that other objects may perform on the
object
• Method: a service or responsibility that an object exposes to other
objects
• Each has a unique identifier
• Limited responsibility and cooperation
myCar : ToyotaTercel
9
UML
The Basics
Dependency Association
Aggregation Composition
Relationships between
objects
10
Relationships between objects
Dependency
• Short-term dependency
• An object may create another object as part of a method, ask it to
perform some function, and then forget about it
11
Relationships between objects
Association
• An object keeps a reference to another object and can call the object’s,
methods as it needs them
• An object may receive an object as a parameter to a configuration
method and keep a reference to the object
12
Relationships between objects
Aggregation
• An object is part of a greater whole
• The contained object may participate in more than one aggregation
relationship, and exists independently of the whole
13
Relationships between objects
Composition
• An object is owned by a greater whole
• The contained object may not participate in more than one composition
relationship and cannot exist independently of the whole
14
UML
The Basics
• Class
• A group of objects that have something in common
• Captures a particular abstraction
• Provides a template for object creation
• Each objects created from a class is identical in
• The type of data they can hold
• The type and number of objects they know about
• The logic for any behavior they provide
+attackKenDoll()
-name : String
-rank : String
#carryingRifle : Boolean
ToySoldier
15
UML
The Basics
• Class Attributes
-Represent the named properties of a UML class
-UML class can have many attributes of different names
-Attributes name is generally a short noun or a noun phrase written in lower Case
first text.
-Attribute decleration may include visility , type
and initial value : +attributesName: type = initial-value
16
UML
The Basics
Class Operations
-Represent named services provided by a UML class
-UML class can have many operations of different names
-Operation name is generally a short verb or a verb phrase written in
lowCase-first text
-Operation may include visibility , parameters and return type:
+opName(param1 : type = initial_value) :return_type
17
UML
The Basics
Class Visibility
-Three levels of class ,attribute and operation visibility:
 private(-), available only to the current class
Protected(#) , available to the current and inherited classes
Public(+), available to the current and other classes.
18
UML
The Basics
• Class Generalization
Represent a relation between a parent (a more abstract class ) and a child ( a
more specific class)
Generally referred to as a “ is -a –kind-of” relationship
Child object may be used instead of parent objects since they share
attributes and operations: the opposite is not true
19
Relationships between Classes
Generalization: an inheritance relationship
 inheritance between classes
 interface implementation
Association: a usage relationship
 Dependency
 Aggregation
 Composition
20
Generalization relationships
• Inheritance : class B is a Class A (or class A is extended by class B)
• Realization : class B realizes Class A (or class A is realized by class B)
21
Associational Relationship
• associational (usage) relationships
1. multiplicity(how many are used)
* ⇒0, 1, or more
1⇒1 exactly
2..4⇒between 2 and 4, inclusive
3..*⇒3 or more
2. name(what relationship the objects have)
3. navigability(direction)
22
Associational Relationship
• Dependency : class A uses class B
• Aggregation : class A has a class B
• Composition : class A owns a class B
23
Multiplicity of associations
One-to One
*each student must carry exactly one ID card
One-to-many
*one rectangle list van contain many rectangles
24
Class diagram example:
video store
25
Modeling Software Systems with the UML
• UML enables building a single coherent model that describes a software system
from several perspectives
• Internal consistency
• Distinct views
• Participants can use the same model and speak the same language throughout
the development process
26
Modeling Process
1. The developers and customers use the UML to understand the problem
from the customer’s point of view
2. The developers use UML to understand the problem from their own point of
view
3. The UML model is used as a resource by the implementers of the system
27
Modeling Process (cont’d)
• Requirements gathering
• Analysis
• Technology selection
• Architecture
• Design and implementation
28
Design and Implementation
• Design
• Use all the results from the previous steps
• Create a model of objects that interact to provide the system’s functionality
• The last chance to validate the solution
• Implementation
• Write the code according to the design
END
29

UML Modeling in Java

  • 1.
  • 2.
    Course: CSE214 (ObjectOriented Programming) Course Teacher: Ms. Rabeya Akhter (RA) Section: P Depertment: CSE(43 Batch) Group Members: 01. Md. Ashaf Uddaula (161-15-7473) 02. Alamin Hossain (161-15-7483) 03. Md. Khasrur Rahman (161-15-7214) 04. Md. Eram Talukder (161-15-7485) 05. Ijaz Ahmed Utsa (161-15-7180) 2
  • 3.
    What Is Modeling? •A model is a simplification with a purpose • Use precisely defined notation to describe and simplify a complex and interesting structure, phenomenon, or relationship • Real-world examples • The solar system model • Mathematical models 3
  • 4.
    What Is Modeling?(cont’d) • Simplification • Less complex, more accessible • Varying perspectives • Describe the system from different perspectives • Help developers manage complexity • Common notation • To facilitate communication • Allows developers to combine their efforts and to work in parallel 4
  • 5.
    UML • Unified ModelingLanguage • A language for specifying, visualizing, constructing, and documenting the artifacts of software systems • A set of precise notations • Helps developers create ideas and communicate them 5
  • 6.
    UML The Basics Abstraction • Asimplification or model of a complex concept, process, or real-world object • Help people understand something at an appropriate level • Different people would build different abstractions for the same concept • Highlight the characteristics and behavior of something that is too complex to understand in its entirety 6
  • 7.
    UML The Basics Encapsulation • Highlightthe important aspects of an object • Hide the cumbersome internal details of the object • Make the system easier to understand and to reuse • Make a system more extendible 7
  • 8.
    UML The Basics Union ofall Modeling Languages Use case diagrams Class diagrams Object diagrams Sequence diagrams Collaboration diagrams Statechart diagrams Activity diagrams Component diagrams  Deployment diagrams …. 8
  • 9.
    UML The Basics • Object •A particular and finite element in a large model • Visible or invisible • Persistent or transient • State: describes characteristics and current condition • Behavior: defines the actions that other objects may perform on the object • Method: a service or responsibility that an object exposes to other objects • Each has a unique identifier • Limited responsibility and cooperation myCar : ToyotaTercel 9
  • 10.
    UML The Basics Dependency Association AggregationComposition Relationships between objects 10
  • 11.
    Relationships between objects Dependency •Short-term dependency • An object may create another object as part of a method, ask it to perform some function, and then forget about it 11
  • 12.
    Relationships between objects Association •An object keeps a reference to another object and can call the object’s, methods as it needs them • An object may receive an object as a parameter to a configuration method and keep a reference to the object 12
  • 13.
    Relationships between objects Aggregation •An object is part of a greater whole • The contained object may participate in more than one aggregation relationship, and exists independently of the whole 13
  • 14.
    Relationships between objects Composition •An object is owned by a greater whole • The contained object may not participate in more than one composition relationship and cannot exist independently of the whole 14
  • 15.
    UML The Basics • Class •A group of objects that have something in common • Captures a particular abstraction • Provides a template for object creation • Each objects created from a class is identical in • The type of data they can hold • The type and number of objects they know about • The logic for any behavior they provide +attackKenDoll() -name : String -rank : String #carryingRifle : Boolean ToySoldier 15
  • 16.
    UML The Basics • ClassAttributes -Represent the named properties of a UML class -UML class can have many attributes of different names -Attributes name is generally a short noun or a noun phrase written in lower Case first text. -Attribute decleration may include visility , type and initial value : +attributesName: type = initial-value 16
  • 17.
    UML The Basics Class Operations -Representnamed services provided by a UML class -UML class can have many operations of different names -Operation name is generally a short verb or a verb phrase written in lowCase-first text -Operation may include visibility , parameters and return type: +opName(param1 : type = initial_value) :return_type 17
  • 18.
    UML The Basics Class Visibility -Threelevels of class ,attribute and operation visibility:  private(-), available only to the current class Protected(#) , available to the current and inherited classes Public(+), available to the current and other classes. 18
  • 19.
    UML The Basics • ClassGeneralization Represent a relation between a parent (a more abstract class ) and a child ( a more specific class) Generally referred to as a “ is -a –kind-of” relationship Child object may be used instead of parent objects since they share attributes and operations: the opposite is not true 19
  • 20.
    Relationships between Classes Generalization:an inheritance relationship  inheritance between classes  interface implementation Association: a usage relationship  Dependency  Aggregation  Composition 20
  • 21.
    Generalization relationships • Inheritance: class B is a Class A (or class A is extended by class B) • Realization : class B realizes Class A (or class A is realized by class B) 21
  • 22.
    Associational Relationship • associational(usage) relationships 1. multiplicity(how many are used) * ⇒0, 1, or more 1⇒1 exactly 2..4⇒between 2 and 4, inclusive 3..*⇒3 or more 2. name(what relationship the objects have) 3. navigability(direction) 22
  • 23.
    Associational Relationship • Dependency: class A uses class B • Aggregation : class A has a class B • Composition : class A owns a class B 23
  • 24.
    Multiplicity of associations One-toOne *each student must carry exactly one ID card One-to-many *one rectangle list van contain many rectangles 24
  • 25.
  • 26.
    Modeling Software Systemswith the UML • UML enables building a single coherent model that describes a software system from several perspectives • Internal consistency • Distinct views • Participants can use the same model and speak the same language throughout the development process 26
  • 27.
    Modeling Process 1. Thedevelopers and customers use the UML to understand the problem from the customer’s point of view 2. The developers use UML to understand the problem from their own point of view 3. The UML model is used as a resource by the implementers of the system 27
  • 28.
    Modeling Process (cont’d) •Requirements gathering • Analysis • Technology selection • Architecture • Design and implementation 28
  • 29.
    Design and Implementation •Design • Use all the results from the previous steps • Create a model of objects that interact to provide the system’s functionality • The last chance to validate the solution • Implementation • Write the code according to the design END 29