Informática II Prof. Dr. Gustavo Patiño MJ 16- 18 05-09-2013
Dec 15, 2015
A model is a simplification of reality.Main reason for developing models:
Understanding the system being developed.
We build models of complex systems because we can not comprehend such a system in its entirety.
Informática II. Facultad de Ingeniería. Universidad de Antioquia. 2013-2
The choice of the model has a significant impact on how the problem is approached and how a solution is devised. A model can be expressed at different
levels of precision. A good model is connected to reality. A single model is not sufficient to represent
most systems.▪ A set of nearly independent models are required.
Informática II. Facultad de Ingeniería. Universidad de Antioquia. 2013-2
Modeling is an essential part of all the disciplines in engineering, including software engineering.
The importance of having a “good” model increases with the complexity of the project.
Informática II. Facultad de Ingeniería. Universidad de Antioquia. 2013-2
Software engineering is an engineering discipline. A modeling technique suitable for the
programming approach should be used. Since object-oriented approach has
proven to be superior to other approaches, models designed for this approach are widely used in software engineering.
Informática II. Facultad de Ingeniería. Universidad de Antioquia. 2013-2
Objects are abstractions of real-world or system entities and manage themselves.
Objects are independent and encapsulate state and representation information.
Informática II. Facultad de Ingeniería. Universidad de Antioquia. 2013-2
System functionality is expressed in terms of object services.
Shared data areas are eliminated. Objects communicate by message passing.
Objects may be distributed and may execute sequentially or in parallel.
Informática II. Facultad de Ingeniería. Universidad de Antioquia. 2013-2
Easier maintenance. Objects may be understood as stand-
alone entities.Objects are appropriate reusable
components.For some systems, there may be an
obvious mapping from real world entities to system objects.
Informática II. Facultad de Ingeniería. Universidad de Antioquia. 2013-2
OOA is concerned with developing an object model of the application domain.
OOD is concerned with developing an object-oriented system model to implement requirements.
OOP is concerned with realising an OOD using an OO programming language such as Java or C++.
Informática II. Facultad de Ingeniería. Universidad de Antioquia. 2013-2
Object Orientation Abstraction Encapsulation Modularity Hierarchy
Informática II. Facultad de Ingeniería. Universidad de Antioquia. 2013-2
A model that includes most important aspects of a given problem while ignoring less important details.
An example of an item purchasing abstraction.
Informática II. Facultad de Ingeniería. Universidad de Antioquia. 2013-2
Counter
Queue Item
Hide implementation from clients Clients depend on interface
Informática II. Facultad de Ingeniería. Universidad de Antioquia. 2013-2
The breaking up of something complex into manageable pieces or modules
Canteen System
Queue
Order Placement
Delivery
Billing
Informática II. Facultad de Ingeniería. Universidad de Antioquia. 2013-2
Level of abstraction
Increasing abstraction
Decreasing Abstraction
Art
Music Films Sculptures
R&B Rap Sci-Fi Action
Informática II. Facultad de Ingeniería. Universidad de Antioquia. 2013-2
ObjectClassAttributesOperation Interface (Polymorphism)ComponentsPackageSubsystemRelationships
Informática II. Facultad de Ingeniería. Universidad de Antioquia. 2013-2
Informally, an object represents an entity, either physical, conceptual, or software Physical entity
Conceptual entity
Software entity
truck
Chemical Process
Linked List Data Structure
Informática II. Facultad de Ingeniería. Universidad de Antioquia. 2013-2
An object is a concept, abstraction, or thing with sharp boundaries and meaning for an application
An object is something that has State Behavior Identity
Informática II. Facultad de Ingeniería. Universidad de Antioquia. 2013-2
The state of an object is one of the possible conditions in which an object may exist
The state of an object normally changes over time
Represented by: Attribute values + Links (relationship instances)
Y.Welikala
Name:
Employee ID:
Date hired:
Status:
Y.Welikala
567138
Oct 18, 2004
Teaching
Informática II. Facultad de Ingeniería. Universidad de Antioquia. 2013-2
Behavior determines how an object acts and reacts to requests from other objects
Behavior is represented by the set of messages it can respond to (the operations the object can perform)
Registration System
Assign Y.Welikala
(Returns: confirmation)
CS 201 Course
Informática II. Facultad de Ingeniería. Universidad de Antioquia. 2013-2
Each object has a unique identity, even if its state is identical to that of another object
Y. Welikala Teaches OOP
“Y.Welikala” Teaches OOP
“Y.Welikala” Teaches OOP
Informática II. Facultad de Ingeniería. Universidad de Antioquia. 2013-2
An object is represented as rectangles with underlined names
: Lecturer
Y.Welikala : Lecturer
Class Name Only
Class and Object Name
Y.Welikala
Object Name Only
Informática II. Facultad de Ingeniería. Universidad de Antioquia. 2013-2
Intro to OO 201
Algebra 110
Electricity 100
Algorithms 202
ThermalDynamics 110
Electronics 110
English 101
Informática II. Facultad de Ingeniería. Universidad de Antioquia. 2013-2
A class is a description of a group of objects with common properties (attributes), behavior (operations), relationships, and semantics. An object is an instance of a class
Informática II. Facultad de Ingeniería. Universidad de Antioquia. 2013-2
A class is an abstraction in that it: Emphasizes relevant characteristics Suppresses other characteristics
Informática II. Facultad de Ingeniería. Universidad de Antioquia. 2013-2
Class
CourseProperties
Name
Location
Days offered
Credit hours
Start time
End time
Behavior
Add a student
Delete a student
Get course roster
Determine if it is full
Informática II. Facultad de Ingeniería. Universidad de Antioquia. 2013-2
How many class can you see?
Informática II. Facultad de Ingeniería. Universidad de Antioquia. 2013-2
A class is an abstract definition of an object It defines the structure and behavior of
each object in the class It serves as a template for creating
objectsObjects may be grouped into classesLecturer
Lecturer Yohan Lecturer Chinthana Lecturer Smith
Informática II. Facultad de Ingeniería. Universidad de Antioquia. 2013-2
Class
Attribute
CourseOffering
numberstartTimeendTime
:CourseOfferingNumber=CS201
endTime=1230startTime=1030
Object
Attribute Value
:CourseOfferingNumber=CS202
endTime=1500startTime=1300
Informática II. Facultad de Ingeniería. Universidad de Antioquia. 2013-2
CourseOffering
addStudent
deleteStudent
getStartTime
getEndTime
Class
Operation
Informática II. Facultad de Ingeniería. Universidad de Antioquia. 2013-2
What are the game’s objects?
What do those objects know how to do?
What properties do they have?
Informática II. Facultad de Ingeniería. Universidad de Antioquia. 2013-2
What are the game’s objects? piece, board
Capabilities: What do those objects know how to do? piece:▪ be created▪ fall▪ rotate▪ stop at collision
Informática II. Facultad de Ingeniería. Universidad de Antioquia. 2013-2