1 / 34

Object Technology

Object Technology. Course Aim. The Object Technology course will -. Examine the differences between procedural and object-oriented programming; Explain the principles, characteristics and benefits of object technology; Present the concepts underlying distributive object processing; and

flann
Télécharger la présentation

Object Technology

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. Object Technology

  2. Course Aim The Object Technology course will - • Examine the differences between procedural and object-oriented programming; • Explain the principles, characteristics and benefits of object technology; • Present the concepts underlying distributive object processing; and • Introduce and contrast approaches to object persistence in databases.

  3. Course Objectives • Name and discuss the three foundational concepts upon which object technology is built • Given a list of terms and characteristics of object methodology, correctly match them with a list of definitions • Contrast object-oriented and traditional programming and identify the benefits of object orientation • Describe the benefits of objects residing and operating remotely, and identify the mechanisms necessary for distributing objects • Given names of four persistence mechanisms, provide at least one advantage and one disadvantage of using each as a database for objects. The successful learner will be able to -

  4. From Productivity to Adaptivity... • After 50 years of information-systems evolution, computers hinder more than help the process of change • Systems block urgently needed competitive change • 80 - 90% of the average software development budget goes to maintenance. (Only 40% in the 1970’s!) • Answer has been more productive software construction (4GLs, CASE tools and object oriented programming) • Better answer is to build more adaptive systems • Software systems must be flexible, easily modified to meet new opportunities and challenges

  5. The History of Object Technology... • Basic concepts of object programming were incorporated in “Simula” (simulation language) developed in Norway in the late 60s to simulate real world processes • Fundamentals of object orientation are as old as universe • Simula was developed to build working models of complex physical systems involving 1,000s of components • The technology is only now gaining commercial attention • Most popular languages now are Smalltalk, C++ and Java • Ada and object COBOL now qualify; Visual Basic v5 lacks only inheritance • The promise of object orientation is worth a careful look

  6. ? ? ? Basic Concepts of Object Orientation • Objects and Encapsulation • Classes and Inheritance • Messages and Polymorphism Object programming more closely duplicates real-world processes than traditional programming because it more nearly models nature’s own means of managing complexity and adapting to change.

  7. maxSpeed contents fuelCapacity loadCapacity Objects... FreightVehicle moveTo Methods (Functionality) Attributes Attributes are what an object knows (Behavior) Attributes are usually private turn (Variables) load Methods are what an object does Information hiding is necessary to strong modularity Methods are usually public unload chgSpeed Property stop An object is any person, place, event, thing, screen, report or concept that applies to the system defined An object is any person, place, event, thing, screen, report or concept that applies to the system defined

  8. FreightVehicle moveTo Methods Attributes (Functionality) turn load (Variables) unload chgSpeed stop loadCapacity contents fuelCapacity maxSpeed Objects and Encapsulation... Encapsulation hides what an object knows and does Abstraction determines what an object knows and does Encapsulation encloses an object's state and behavioral characteristics, and is the means by which information hiding and modularity are implemented. Encapsulation encloses an object's state and behavioral characteristics, and is the means by which information hiding and modularity are implemented.

  9. Advantages of Encapsulated Objects • Data is wrapped with procedures as in the real world • Objects make ideal software modules, designed and maintained independently of one another • Objects are a natural way of viewing complexity • Each object models its own range of behavior, and has data about its status -- a self-contained universe • Global data does not exist; cannot be corrupted • An object’s data is protected, secure from outside tampering • Well defined and “wrapped” objects are highly reusable

  10. Basic Concepts of Object Orientation • Objects and Encapsulation • Classes and Inheritance • Messages and Polymorphism Encapsulation is the separation of an object’s external interface from its internal implementation. A class is a set of objects that share common inherited structure and behavior. ? ?

  11. Classes... Classes group similar objects. How many classes to which these objects belong can you name? Classes group similar objects. How many classes to which these objects belong can you name?

  12. Methods Values Methods Values Values Values Values Values Values Values Methods Methods Methods Methods Classes... and Inheritance... Superclass Objects and classes inherit and can override commonalties Inheritance provides for special cases of a class, thus classhierarchies Objects Subclasses Subclasses inherit common methods and variables from the superclass. A class can override inherited attributes and methods. Subclasses inherit common methods and variables from the superclass. A class can override inherited attributes and methods.

  13. Superclass Mammals Superclass People Athletes Where do these fit? Workers What Class is this? Class Hierarchy... Subclass of what Superclass? Animals Subclasses Sea Creatures Classes not only group similar objects. They group classes within classes -- subclasses within superclasses. Classes not only group similar objects. They group classes within classes -- subclasses within superclasses.

  14. Basic Concepts of Object Orientation • Objects and Encapsulation • Classes and Inheritance • Messages and Polymorphism Inheritance takes advantage of the similarities between classes, and messaging accomplishes the natural interaction of objects needed to accomplish work. ?

  15. Message Signature: Class 2 Methods ObjectName.Method (Parameters) Methods Return Value: (Result, if any) (__________) Messages... and Polymorphism... Truck train.shipTo (1000, Chicago) Interface Different objects can respond to the same message Class 1 Sender Train Interface Receiver Real-world objects have an infinite variety of effects on one another, effects implemented through messages. Real-world objects have an infinite variety of effects on one another, effects implemented through messages.

  16. More characteristics of objects... Composite Objects, or Aggregation Aggregation expresses ‘is-part-of’ relationships Component objects are part of an aggregation Objects that contain other objects are called composite objects; their member objects are called components. Objects that contain other objects are called composite objects; their member objects are called components.

  17. Seat Seat Seat Seat Seat Seat Seat Seat Seat Seat Seat Seat Seat Seat Seat Seat Seat Seat More characteristics of objects... Collections What collections can be found in your house? Cabins: First Business Economy There is a special kind of class called a collection class, which allows managing like objects as a group. There is a special kind of class called a collection class, which allows managing like objects as a group.

  18. More characteristics of objects... Collaboration Delegation of tasks is the way objects collaborate to get work done Objects, like people, must often collaborate in order to get the job done. Objects, like people, must often collaborate in order to get the job done.

  19. More characteristics of objects... Coupling and Cohesion Software systems that are easily maintained are loosely coupled and highly cohesive. Software systems that are easily maintained are loosely coupled and highly cohesive.

  20. Methods Values Athletes Methods Values Values Values Values Values Methods Methods Methods More characteristics of objects... Abstract classes An abstract class cannot have objects instantiated from it. A class from which objects can be created is a concrete class Abstract classes are general, high-level classes created for greater organization; they also serve as inheritance templates. Abstract classes are general, high-level classes created for greater organization; they also serve as inheritance templates.

  21. More characteristics of objects... Instance Relationships Cardinality determines the number of instances in the relationship Optionality expresses whether the relationship is required Objects are related to one another as expressed in the verbs that connect them, for example, students take courses. Objects are related to one another as expressed in the verbs that connect them, for example, students take courses.

  22. Distributing Objects • Networked environments introduce several issues about where programmed classes and objects should reside. • How should business logic be divided among network computers? • On which computer should a class be implemented? • How can computers on the network be most efficiently used? • Distributed classes is one architecture for placing classes of business logic on computers based on their behavior • Traditional client/server approach • Peer-to-peer client/server approach • Applets • Problem: The class may not be where needed at time of process • Better to distribute objects so they dynamically reside on the machine most appropriate for the current process • The object request broker (ORB) is middleware enabling objects to send messages to remote objects

  23. Server Response Receiver Request ORB Server Sender Distributed objects... The first requirement is a remote messaging architecture using a message channel Message bus The (ORB) object request broker enables objects to communicate across the network CORBA is the ORB standard with an interface definition language (IDL) that defines services Distributed Objects are objects that dynamically move about the network and reside anywhere they are currently needed. Distributed Objects are objects that dynamically move about the network and reside anywhere they are currently needed.

  24. Server Response Receiver Request ORB Server Sender Distributed objects... An essential element is location transparency Location Service Message bus Location transparency relieves objects of maintaining object locations The Location Service is a service of the ORB The sender of a message first asks the location service for the receiver’s location, then sends its message. The sender of a message first asks the location service for the receiver’s location, then sends its message.

  25. Server Response Receiver Proxy object Request ORB Server Sender Distributed objects... A further step is remoteness transparency Message bus A proxy object serves as a local representative of a remote object Remoteness transparency hides the fact the receiving object is on a different machine A Proxy Object presents the interface of the remote object it represents to objects on the local machine appearing to them as a local object. A Proxy Object presents the interface of the remote object it represents to objects on the local machine appearing to them as a local object.

  26. Server Server Mobile Object Distributed objects... The ideal level of implementation is mobile objects Mobile objects allow dynamic load balancing of system resources Java allows definition of mobile objects in its support for agents Mobile objects move freely from machine to machine within a virtual object space as they are needed. Mobile objects move freely from machine to machine within a virtual object space as they are needed.

  27. Mobile Objects Ideal Remoteness Transparency Location Transparency Remote Messaging Basic Distributed objects summary Levels of object distribution implementation Each higher level of implementation depends upon the lower implementation(s). Each higher level of implementation depends upon the lower implementation(s).

  28. Making objects persistent... • Persistence deals with how objects will be stored between invocations of an object-oriented application • Persistent objects must be available & work correctly when needed • Other terminology important to this discussion: • Persistence mechanism - permanent storage facility • Persistence layer - the collection of classes necessary for providing and maintaining persistence. The layer wraps the mechanism. • Object identifier (OID) - Typically a large, unique integer used as a “key” for accessing an object. • There are four common mechanisms: • Flat files • Relational databases • Object-oriented databases • Object/relational databases

  29. Object Object Object Object Object Object Object Data Dictionary Making objects persistent... A common approach is using flat, or single, data files The biggest design issue is whether to read/write sequentially or randomly A flat file is a file of text or images Flat File Map Flat File

  30. Relational Database Object Object Object Object Object Object Object Data Dictionary Making objects persistent... The most widely used technique is relational databases Persistent object uses data from the dictionary to create dynamic SQL statements for accessing the database Relational databases can store object-oriented systems, especially attributes Persistent Object

  31. Making objects persistent... The latest technology is object-oriented databases • An OODBMS stores an object’s attributes and methods • This is a fundamental premise of object technology • Designed specifically for object-oriented systems • Supports encapsulation, inheritance and polymorphism • Good systems support object distribution across the network • Security - restricted access at database, class or object levels • Version control that recognizes functions as well as data Organized, workable approach OR time- bomb -- it depends on your design

  32. Really the best of two worlds? -- Maybe! Making objects persistent... A hybrid approach is object/relational databases • An attempt to combine the advantages of two database worlds for storing both data and objects • The relational ability to work with tables of columns and rows • Plus the ability to encapsulate both data and functionality • Traversing objects in the database is easy, thus supporting complex relationships between objects • Object/relational databases implement - • Inheritance mapping of the type used with relational databases • Extensions to SQL for accessing objects as well as data • Methods in tables • Easy traversal between objects • Better than relational, but easy to fall back into old relational design habits

  33. Course Objectives • Name and discuss the three foundational concepts upon which object technology is built • Given a list of terms and characteristics of object methodology, correctly match them with a list of definitions • Contrast object-oriented and traditional programming and identify the benefits of object orientation • Describe the benefits of objects residing and operating remotely, and identify the mechanisms necessary for distributing objects • Given names of four persistence mechanisms, provide at least one advantage and one disadvantage of using each as a database for objects. The successful learner will be able to -

  34. Thanks for your participation... Your comments and suggestions toward improving this course are welcome…..

More Related