You are on page 1of 22

ITEL-305

System Integration and


Architecture 2

Prepared by: Jeremy C. Reyes


Topic Covered:
✘ UML Diagram
✘ UML Definition
✘ UML Modeling
✘ UML Class
✘ UML Class Diagram
✘ Class and Object
✘ Review of OOP Concept
✘ Abstraction
✘ Encapsulation
✘ Inheritance
✘ Polymorphism
✘ Sample JAVA Programming
2
Objective:
At the end of the lesson the student should be able to:

✘ Understand UML Class Diagram


✘ Describe OOP Concept in Java
✘ Understand Java Programming in UML Class

3
1.
Unified Modeling Language
CLASS

4
UML
Unified Modeling Language
o It is an industry-standard graphical language, specifying, visualizing, constructing and documenting
the artifacts of software system.
o UML combines technique from;
• Object modeling
• Data modeling
• Business modeling
• Component Modeling

Modeling is a diagram with graphical representation of system model, UML diagram represent two
different views of system model;
1. Static (Structural Model)
2. Dynamic (Behavioral Model)
5
UML
Modeling
1. Static or Structural View – the view emphasizes the static structure of a
system using objects, attributes, operations and relationship.
Example is Class Diagram
2. Dynamic or Behavioral View – the view emphasizes the dynamic behavior of
the system by showing collaboration among object and changes to the
internal states of object.
Example: Sequence diagram, Activity diagram, State diagram and
Use Case diagram.

6
UML Class Diagram

A UML CLASS DIAGRAM


- Describe classes and their relationship
- In a UML Diagram Class is denoted as a
rectangular shape box usually divided into
three parts.
- Classes define the blueprint for an object
- An object are custom variables which
contain state and behavior
- State is represented as properties and
behavior as methods.
7
UML Class Diagram

A UML CLASS DIAGRAM


Declare Class name here (should
always be in Uppercase Letter first)

Attributes in the middle part (also


called fields, variables)

Behaviors (Methods)

8
UML Class Diagram

A UML CLASS DIAGRAM

Visibility – Set the accessibility for


the attributes and methods
- Private
+ Public
# Protected
~ Package/default

9
UML Class Diagram
Animal
CLASS NAME
- name: String;
- age: int;
VISIBILITY - weight: float;
+ setName();
+ getName();
+ setAge(); ATTRIBUTES OF THE
+ getAge(); CLASS
+ setWeight();
+ getWeight(); METHODS

10
UML Class Diagram

A UML CLASS RELATIONSHIP

GENERALIZATION / INHERITANCE
Known as an “is a” relationship since the child class is a type of the parent class. Generalization is
the ideal type of relationship that is used to showcase reusable elements in the class diagram.
Literally, the child classes “inherit” the common functionality defined in the parent class.

11
UML Class Diagram <<Animal>>
- name: String;
- age: int;
- weight: float;
SUB CLASS /
SUPER CLASS / CHILD CLASS
PARENT CLASS
+eat();

Generalization /
Inheritance

<<Dog>> <<Cat>> <<Bird>>

+playDead();

12
UML Class Diagram

A UML CLASS RELATIONSHIP


Bird
ASSOCIATION
an association that exists
between classes is bi-
directional. Ideally, you may
illustrate the flow of the
association by utilizing a eats Seeds
directed association.

13
UML Class Diagram

A UML CLASS RELATIONSHIP

Aggregation

When a class is formed as a


collection of other classes, it
is called an aggregation
relationship between these
classes. It is also called a “has
a” relationship.

14
UML Class Diagram

A UML CLASS RELATIONSHIP

Composition
The composition is a
variation of the
aggregation relationship.
Composition illustrates
that a strong life cycle is
present between the
classes.
15
UML Class Diagram

A UML CLASS RELATIONSHIP

Multiplicity

the relationship shows a star sign


(one to many and many to many etc).

16
UML Class Diagram

17
2.
Review of OOP CONCEPTS
Inheritance, Abstraction, Encapsulation, Polymorphism

18
Review of OOP Concepts

Inheritance Abstraction
Is a mechanism in which one Is a process of hiding the
object acquires all the properties implementation details and
and behaviors of a parent object. showing only functionality to the
user.
Represent an “Is A” and “Has A”
relationship

19
Review of OOP Concepts

Polymorphism Encapsulation
Is a concept by which we can Is a process of writing code and
perform a single action in data together into single unit.
different ways. Derived in Greek We can create a fully
words poly and morphs. Poly encapsulated class in Java by
means many and morphs means making all the data members of
many forms. the class private. We can use the
setter and getter methods to
set and get the data in it.
20
thanks!
Any questions?

21
hello!
I am Jeremy
For any inquiry feel free to contact me @
jeremyreyes33218@gmail.com

22

You might also like