0% found this document useful (0 votes)
17 views44 pages

Chapter 5_Object Modeling_UML

Uploaded by

Võ Kha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views44 pages

Chapter 5_Object Modeling_UML

Uploaded by

Võ Kha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 44

ANALYSIS & DESIGN OF MANAGEMENT INFORMATION SYSTEM

OBJECT MODELING & UML


Lecturer: NGUYEN DAC QUYNH MI
Object-oriented Analysis
▪ Object-oriented (O-O) analysis describes an information system by
identifying things called objects.
▪ An object represents a real person, place, event, or transaction.
For example, when a patient makes an appointment to see a doctor, the
patient is an object, the doctor is an object, and the appointment itself is an
object.
▪ O-O analysis is a popular approach that sees a system from the viewpoint of
the objects themselves as they function and interact.
▪ The end product of O-O analysis is an object model, which represents the
information system in terms of objects and O-O concepts

2
Object-oriented Analysis
▪ The Unified Modeling Language (UML) is a widely used method of
visualizing and documenting an information system. In this chapter, the
UML is used to develop object models.
▪ The first step is to understand basic O-O terms, including objects,
attributes, methods, messages, and classes.
▪ This chapter shows how systems analysts use those terms to describe an
information system.

3
Objects

4
Objects

5
Attributes
▪ An object has certain attributes, which are characteristics that describe the
object. If objects are similar to nouns, attributes are similar to adjectives
that describe the characteristics of an object. For example, a car has
attributes such as make, model, and color.

▪ Objects can have a specific attribute called a state. The state of an object is
an adjective that describes the object’s current status. For example,
depending on the state, a student can be a future student, a current
student, or a past student.

6
Methods
▪ An object also has methods, which are tasks or functions that the object
performs when it receives a message, or command, to do so. For example,
a car performs a method called OPERATE WIPERS when it is sent a
message with the wiper control, and it can APPLY BRAKES when it is sent a
message by pressing the brake pedal.

▪ Just as objects are similar to nouns and attributes are similar to adjectives,
methods resemble verbs that describe what and how an object
does something.

7
Messages

▪ A message is a command that tells an object to perform a certain method.

▪ For example, the message PICK UP TOYS directs the CHILD class to
perform all the necessary steps to pick up the toys. The CHILD class
understands the message and executes the method

8
Messages
▪ The same message to two different objects can produce different results.
The concept that a message gives different meanings to different objects
is called polymorphism.

▪ For example, in Figure 6-4, the message GOOD NIGHT signals the PARENT
object to read a bedtime story, but the same message to the CHILD object
signals it to get ready for bed. If the family also had a DOG object, the
same message would tell the dog to sleep.

9
Messages

10
Messages
▪ An object can be viewed as a black box, because a message to the object
triggers changes within the object without specifying how the changes
must be carried out.

▪ The black box concept is an example of encapsulation, which means that


all data and methods are self-contained. A black box does not want or
need outside interference. By limiting access to internal processes, an
object prevents its internal code from being altered by another object or
process. Encapsulation allows objects to be used as modular components
anywhere in the system, because objects send and receive messages but
do not alter the internal methods of other objects.

11
Messages

▪ O-O designs typically are implemented with O-O programming languages.


A major advantage of O-O designs is that systems analysts can save time
and avoid errors by using modular objects, and programmers can translate
the designs into code, working with reusable program modules that have
been tested and verified.

12
Classes
▪ An object belongs to a group or category called a class. For example, Ford
Fiestas belong to a class called CAR. An instance is a specific member of a
class. A Toyota Camry, for example, is an instance of the CAR class.

▪ At an auto dealership, many instances of the CAR class may be observed:


the TRUCK class, the MINIVAN class, and the SPORT UTILITY VEHICLE class,
among others.

▪ All objects within a class share common attributes and methods, so a class
is like a blueprint or template for all the objects within the class. Objects
within a class can be grouped into subclasses, which are more specific
categories within a class.

13
Classes

14
Classes

15
Relationships among Objects and Classes
▪ Relationships enable objects to communicate and interact as they
perform business functions and transactions required by the system.

▪ Relationships describe what objects need to know about each other, how
objects respond to changes in other objects, and the effects of
membership in classes, superclasses, and subclasses. Some
relationships are stronger than others (just as a relationship between
family members is stronger than one between casual acquaintances).

▪ The strongest relationship is called inheritance. Inheritance enables an


object, called a child, to derive one or more of its attributes from another
object, called a parent.

16
Relationships
among Objects
and Classes

17
Relationships
among Objects
and Classes

18
Example 1
Tình huống:
▪ Xây dựng 1 hệ thống quản lý kho để theo dõi hàng hóa,
nhà cung cấp và đơn hàng. Hệ thống này sẽ giúp quản lý
thông tin về sản phẩm, đảm bảo rằng hàng hóa luôn sẵn có
và dễ dàng theo dõi các đơn hàng.
a. Xác định các Class cần thiết trong hệ thống.
b. Xác định Attributes và Methods trong từng class.
c. Mô tả 1 kịch bản cụ thể vận hành hệ thống kho này thể
hiện sự tương tác giữa các đối tượng thuộc các class đã
xác định.

19
Example 1
• Product
• Attributes: product_id, product_name, description,
quantity, price
• Methods: update_quantity(), get_product_detail()
• Supplier
• Attributes: supplier_id, supplier_name, contact_info
• Methods: get_supplier_info()

20
Example 1
• Order
• Attributes: order_id, product, supplier, order_date, quantity
• Methods: create_order(), get_order_summary()
• Inventory
• Attributes: products
• Methods: add_product(), remove_product(), check_inventory()

21
Example 1
• Tạo đơn hàng để đặt mua sản phẩm từ 1 nhà cung cấp
• Cập nhật số lượng sản phẩm trong kho sau khi nhập
hàng.

22
Example 2
Tình huống:
▪ Xây dựng một hệ thống quản lý điểm cho sinh viên
tại một trường đại học. Hệ thống này sẽ giúp theo
dõi thông tin về sinh viên, môn học, điểm số và quản
lý lớp học.
a. Xác định các Class cần thiết trong hệ thống.
b. Xác định Attributes và Methods trong từng class.

23
Examples

Hệ thống POS (bán hàng) & Các sơ đồ UML


https://coderkiemcom.com/blog/guide/phan-
mem-ban-hang-pos

24
Class Diagram
1. https://coderkiemcom.com/blog/guide/class-diagram-va-uml-cho-phan-mem-
ban-hang-pos
2. https://drive.google.com/file/d/1YOQVrf-dxVTLI3SdIb2QGXi49AjWZIku/view

25
Use case diagram
1. https://coderkiemcom.com/blog/guide/use-case-diagram-cho-phan-mem-ban-
hang-pos
2. https://drive.google.com/file/d/1HEu8BjF6kKGoJaM4E0TSwTz7-jzN65IZ/view

26
Activity Diagram
1. https://coderkiemcom.com/blog/guide/activity-diagram-cho-phan-mem-ban-
hang-pos

27
Data Flow Diagram (DFD)
1. https://coderkiemcom.com/blog/guide/system-dfd-cho-phan-men-ban-hang-pos

28
Database Design
1. https://coderkiemcom.com/blog/guide/thiet-ke-co-so-du-lieu-he-thong-ban-
hang-va-quan-ly-kho

29
30
31
32
33
34
35
36
37
38
39
40
41
42
Use case Diagram & Relationships
▪ https://thinhnotes.com/chuyen-nghe-ba/use-case-diagram-va-5-sai-lam-thuong-
gap/

43
THANK YOU

It’s time for your questions

44

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy