1 / 39

Components

Components. Lecture Six. Component Technologies. Interfaces. Ways of Providing Interfaces. Contracts. JavaBeans Architecture. Integrating JavaBeans. Serialization. Introspection. Design Pattern for Event Listerners. Event Source. Component Architecture.

virote
Download Presentation

Components

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. Components Lecture Six

  2. Component Technologies

  3. Interfaces

  4. Ways of Providing Interfaces

  5. Contracts

  6. JavaBeans Architecture

  7. Integrating JavaBeans

  8. Serialization

  9. Introspection

  10. Design Pattern for Event Listerners

  11. Event Source

  12. Component Architecture • Pivotal basis for any large scale software technology • utmost important for component-based systems • foundation for software maintenance and evolution

  13. Elements in Component Architecture • Interactions between components and their environment • Roles of components • Tool interfaces • User interface for end users and assemblers

  14. Component System Architecture • Consists of • a set of platform decisions • a set of component frameworks • an interoperation design for the component frameworks

  15. Platforms • Base for installing, instantiating and activating components and component frameworks • Can be concrete or virtual • concrete: direct support from hardware • virtual: platform abstract/emulation

  16. Component Frameworks • A dedicated and focused architecture, usually around a few key mechanisms, and a fixed set of policies for mechanisms at the component level • protocols for connecting participating components • enforcing policies

  17. Interoperation Design • Rules of interoperation among all the frameworks joined by the system architecture

  18. Components and Atomic Components • A component is a set of simultaneously deployed atomic components • An atomic component is a module and a set of resources • A module is a set of classes and possibly non-OO procedures • dependency graph must be acyclic • A resource is a ‘frozen’ collection of typed items

  19. Component Frameworks • A software entity that supports components conforming to certain standards and allows instances of these components to be plugged into the framework. • Establishes environment conditions • Regulate component interactions • Implementation inheritance is not normally used, compared with App. Frameworks

  20. Component Frameworks: OpenDoc • OpenDoc • Compound Document Framework • ODPart (60 methods)

  21. Component Oriented Programming • Requires support of • Polymorphism (Substitutability) • Modular encapsulation (Higher level information hiding) • Late binding and loading (independent deployability) • safety (type and module safety)

  22. Problems in Component Wiring by Event Dispatching • Invariants: the system is in an inconsistent state while a multicase in is progress • Relative ordering of multicast • The recipient set could change during multicast • Recipients could raise exceptions

  23. Multithreading • Critical area needs locking • Could introduce deadlock • Handling asynchronous exceptions • Hard to debug

  24. Living without Implementation Inheritance • Severe problems caused by implementation inheritance across component boundaries • Fragile Base Class Problem • syntactic (RRBC) • semantic:

  25. JavaBeans • A Bean is a reusable component that can be manipulated as a live object from within an application builder, is associated with a BeanInfo object that defines the Bean, its customizer, properties,property editor, events, and methods.

  26. Minimum Requirements • Instantiable • Has a default constructor • Implements Serializable or Externalizable

  27. BeanInfo • A Bean is separate from its BeanInfo • A Bean ABC may have ABCBeanInfo • Not directly accessed • Only accessed by Introspector • Introspector takes BeanInfo and information collected by Core Reflection API

  28. OurButton • Compare the code with options from BeanBox

  29. ExplicitButton package sunw.demo.buttons; import java.beans.*; public class ExplicitButton extends OurButton { }

  30. BeanInfo and Customizer • ExplicitButtonBeanInfo.java • ExplicitButtonCustomizer.java

  31. OrangeButton and BlueButton • What are they? • How were they created?

  32. COM • Component Object Model • A binary object interoperability standard • Use cases for using a Binary Component

  33. IUnknown • Interface • HRESULT QueryInterface(REFIID iid,void** ppvObject) • HLONG AddRef() • HLONG Release()

  34. Interfaces • Client of a COM object shlaa interact with the object only via its interfaces • All COM interfaces are based on Iunknown • Given any interface pointer to an object instance, you can get the pointer to any other interface implemented by the object via QueryInterface() method

  35. COM runtime • Create an instance • Partially platform dependent • GUID(UUID) for identifying • classes CLSIDs and • Interfaces IIDs and • … • Uuidgen.exe

  36. Create an instance • CoGetClassObject() for a class factory IClassFactory • Support CreateInstance()

  37. Object Containment and Delegation • Delegation: action of calling a method in the worker object, in response to a method call on one of our own interfaces

  38. Object Agreegation • COM provides a mechanism called aggregation, which allows an aggregator to expose interfaces of its aggregates (worker objects)

  39. Component Frameworks: Blackbox • Focus on compound document based applications • principles/patterns • carrier-rider-mapper • directory object (abstract factory, factory method) • HMVC • cascaded message multicasting • reuse through object composition

More Related