1 / 20

Classes and Inheritance in Actor-Oriented Models

This article introduces the concept of classes and inheritance in actor-oriented models, highlighting the benefits and challenges of using class mechanisms in component-based design. It also discusses the importance of encapsulation, visual languages, and component reuse in complex systems.

Download Presentation

Classes and Inheritance in Actor-Oriented Models

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. Classes and Inheritance in Actor-Oriented Models Stephen Neuendorffer Edward Lee UC Berkeley

  2. Introduction • Component-based design • Object-oriented components • Actor-oriented components • Most Actor-oriented tools lack the class mechanisms of Object-oriented languages. • inheritance • subclassing • A preliminary approach to providing class-like mechanisms in Ptolemy II

  3. Component-based Design Component Component Complex systems built primarily through composition. Encapsulation of intellectual property. Visual languages and design tools. Component reuse.

  4. Object-Oriented Components Provides ports expose methods that can be invoked on this object Requires ports expose methods that this object might invoke. Object • This interface specification allows for consistency checking of compositions. • However, this interface lacks important pieces of information: • Method Requirements. (Sequencing? Preconditions?) • Concurrency constraints. (Deadlock? Re-entrancy?)

  5. Actor-Oriented Components Inputports expose flows of data that this actor consumes. Output ports expose flows of data that this actor produces. Actor • This interface specification allows for consistency checking of compositions. • This interface also lacks important pieces of information: • How data is transported between ports • Concurrency constraints between actors • These are largely orthogonal issues for actors

  6. basic abstraction mechanism is hierarchy. Example of an Actor-Oriented Framework: Simulink

  7. container container copy Hierarchical Abstraction • Complex components can encapsulate smaller components. • Object-oriented delegation pattern hierarchical component

  8. Class mechanisms • Realization: • Most components in a large system operate in the same basic fashion. • Object-oriented classes provide several important capabilities. • Central point of design. • Basis for type checking. • Static compilation. • Extension and variation. • But also present some complications. • Run-time modifications become difficult. • Source of inconsistencies.

  9. Classes and Hierarchy • Classes simplify the structure of complex models. • Classes extend the containment hierarchy with an inheritance hierarchy.

  10. The First (?) Actor-Oriented Programming Language (1966) MIT Lincoln Labs TX-2 Bert Sutherland with a light pen Partially constructed actor-oriented model with a class definition (top) and instance (below). Bert Sutherland used the first acknowledged object-oriented framework (Sketchpad, created by his brother, Ivan Sutherland) to create the first actor-oriented programming framework.

  11. Key Problems • Direct manipulation user interface of both classes and instances. • Maximize syntactic consistency. • Expressive uses of classes • subclasses with extension and overriding • nested classes • Interactive modification of classes • Classes might be modified at runtime • Distinguishing overridden values from inherited default values.

  12. Visual Class Representation Each block is implicitly an instance of an actor class.

  13. An Actor Class Every subclass or instance of this actor class contains at least this structure. Parameter values of actors in a class give default values for all instances of the class

  14. Models with Classes model Derived objects implied by class Actor classes are explicitly instantiated. class instance instance instance Intuition: Modifications to classes propagate to derived objects, as long as local changes have not been made.

  15. A Simple Example Here the property of BaseClass is modified, which does not propagate to Instance2. This example is simple because there is only one propagation path.

  16. A Subclass Dotted lines show inherited objects that cannot be deleted, while allowing syntax-directed editing.

  17. Models with SubClasses model Derived objects implied by class Actor classes are explicitly subclassed. class subclass instance instance instance Changes propagate to subclasses similarly to instances. Subclasses allow for independent extension, while instances do not.

  18. Nested Classes

  19. Models with Nested Classes model class instance class instance instance Nested classes result in multiple propagation paths. Approach: prioritize propagation so that localized changes override global changes.

  20. Summary • Class mechanisms for modularity can be integrated with actor-oriented modeling. • Inherited changes in a syntactically-driven environment can be tricky: • Nested Classes • Still many open questions.. • Consistency given multiple propagations? • Is “Local Override” property the best one?

More Related