1 / 35

Introducción al Paradigma de Orientación a Objetos

Informática II Prof. Dr. Gustavo Patiño MJ 16- 18 05-09-2013. Introducción al Paradigma de Orientación a Objetos. Today's Topics. Engineering Models. A model is a simplification of reality. Main reason for developing models: Understanding the system being developed.

bairn
Download Presentation

Introducción al Paradigma de Orientación a Objetos

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Informática II Prof. Dr. Gustavo Patiño MJ 16- 18 05-09-2013 Introducción al Paradigma de Orientación a Objetos

  2. Today's Topics Informática II. Facultad de Ingeniería. Universidad de Antioquia. 2013-2

  3. Engineering Models • 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

  4. Principles of Modeling • 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

  5. Engineering Models • 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

  6. Models in Software Engineering • 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

  7. Characteristics of Object Oriented Approach • 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

  8. Characteristics of Object Oriented Approach • 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

  9. Advantages of Object Oriented Paradigm • 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

  10. Object-Oriented Paradigm They are related but distinct. Informática II. Facultad de Ingeniería. Universidad de Antioquia. 2013-2

  11. Object-Oriented Paradigm (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

  12. Basic Principles of Object Orientation • Object Orientation • Abstraction • Encapsulation • Modularity • Hierarchy Informática II. Facultad de Ingeniería. Universidad de Antioquia. 2013-2

  13. What is Abstraction? • A model that includes most important aspects of a given problem while ignoring less important details. • An example of an item purchasing abstraction. Counter Item Queue Informática II. Facultad de Ingeniería. Universidad de Antioquia. 2013-2

  14. What is Encapsulation • Hide implementation from clients • Clients depend on interface Informática II. Facultad de Ingeniería. Universidad de Antioquia. 2013-2

  15. What is Modularity? • The breaking up of something complex into manageable pieces or modules Queue Canteen System Order Placement Delivery Billing Informática II. Facultad de Ingeniería. Universidad de Antioquia. 2013-2

  16. What is Hierarchy? • Level of abstraction Art Increasing abstraction Music Films Sculptures R&B Rap Sci-Fi Action Decreasing Abstraction Informática II. Facultad de Ingeniería. Universidad de Antioquia. 2013-2

  17. Basic Concepts Of Object Orientation • Object • Class • Attributes • Operation • Interface (Polymorphism) • Components • Package • Subsystem • Relationships Informática II. Facultad de Ingeniería. Universidad de Antioquia. 2013-2

  18. What is an Object? • 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

  19. The object Model is the center of everything

  20. A More Formal Definition • 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

  21. An Object Has State • 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 567138 Oct 18, 2004 Teaching Name: Employee ID: Date hired: Status: Y.Welikala Informática II. Facultad de Ingeniería. Universidad de Antioquia. 2013-2

  22. An Object Has Behavior • 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) Assign Y.Welikala (Returns: confirmation) Registration System CS 201 Course Informática II. Facultad de Ingeniería. Universidad de Antioquia. 2013-2

  23. An Object Has Identity • 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

  24. Representing Objects • An object is represented as rectangles with underlined names : Lecturer Y.Welikala Class Name Only Y.Welikala : Lecturer Object Name Only Class and Object Name Informática II. Facultad de Ingeniería. Universidad de Antioquia. 2013-2

  25. Example: Objects English 101 Intro to OO 201 Electronics 110 Electricity 100 ThermalDynamics 110 Algebra 110 Algorithms 202 Informática II. Facultad de Ingeniería. Universidad de Antioquia. 2013-2

  26. What is a Class? • 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

  27. What is a Class? (..cont) • 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

  28. Sample Class Class Course Properties 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

  29. Classes of Objects • How many class can you see? Informática II. Facultad de Ingeniería. Universidad de Antioquia. 2013-2

  30. The Relationship Between Classes and Objects • 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 objects • Objects may be grouped into classes Lecturer Lecturer Yohan Lecturer Chinthana Lecturer Smith Informática II. Facultad de Ingeniería. Universidad de Antioquia. 2013-2

  31. What is Attribute? Object Class Attribute :CourseOffering Attribute Value Number=CS201 startTime=1030 endTime=1230 CourseOffering number startTime :CourseOffering endTime Number=CS202 startTime=1300 endTime=1500 Informática II. Facultad de Ingeniería. Universidad de Antioquia. 2013-2

  32. What is Operation? Class CourseOffering addStudent deleteStudent getStartTime Operation getEndTime Informática II. Facultad de Ingeniería. Universidad de Antioquia. 2013-2

  33. Example: Tetris • 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

  34. Example: Tetris (cont.) • 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

  35. Example: Tetris (cont.) • board: • be created • remove rows • check for end of game • Properties: What attributes and components do they have? • piece: • orientation • Position • shape • color • board: • size • rows Informática II. Facultad de Ingeniería. Universidad de Antioquia. 2013-2

More Related