220 likes | 325 Vues
Course structure. 1: Component software principles 2: Javabeans 3: COM (DCOM/COM+/OLE/ActiveX) 4: CORBA, more ActiveX, comparison. Session 1 Outline. Software components definitions, advantages old reuse: Issues in component software interfaces, interface descriptions
E N D
Course structure 1: Component software principles 2: Javabeans 3: COM (DCOM/COM+/OLE/ActiveX) 4: CORBA, more ActiveX, comparison MIT IAP 1999
Session 1 Outline • Software components • definitions, advantages • old reuse: • Issues in component software • interfaces, interface descriptions • transparent distribution: proxies & stubs • persistence • naming, versioning • Demonstration MIT IAP 1999
Component based software Software component • a software building block “A software component is a unit of composition with contractually specified interfaces and explicit context dependencies only. A software component can be deployed independently and is subject to composition by third parties.” [Szyperski 97] MIT IAP 1999
Minimalist component [Orfali, Harkey] • marketable entity: self-contained, shrink-wrapped, binary • not a complete application • usable in unpredicted combinations: ‘plug&play’ • well-specified interface • interoperable: invoked across processes, machines, networks, languages, OS, tools • extended object: supports encapsulation, inheritance, polymorphism MIT IAP 1999
Security Licensing Versioning Life-cycle management Visual assembly Event notification Configuration & property management Scripting Metadata & introspection Transaction control, locking Persistence Self-testing Self-installation Ease-of use Relationships: e.g. containment Supercomponent [Orfali, Harkey] MIT IAP 1999
Component Software Goals • Reuse components raise the bar of what can be reused • Distributed components compatibility transparent distributed computing MIT IAP 1999
Developers Development time & effort Cost Reliability Flexibility End users Custom software specialized, smaller, extensible Integration compound documents, drag & drop Scripting Ease of use Cost Component Software advantages MIT IAP 1999
Buy or Write? flexibility nimbleness competitive edge cost efficiency 0 % bought 100 MIT IAP 1999
Reuse approaches • Libraries • layered, object-oriented • deficiencies: • too fine grained • no location transparency • language specific: low-level workarounds • extension: source needed, fragile base classes • versioning • persistence MIT IAP 1999
Reuse approaches 2 • Frameworks • Set of cooperating classes, that make up a reusable design for specific class of software • Extended: inheritance [template methods] • “Don’t call us, we’ll call you” • Deficiencies: • cannot be composed • language specific • Others: design patterns, languages MIT IAP 1999
Component examples • Visual Basic • Modern operating systems • Plug-ins • Netscape, Photoshop, Quicktime, Mac OS • Emacs packages • Compound documents MIT IAP 1999
Some component types • middleware components • logic components • vertical components • GUI components • container components MIT IAP 1999
Component standards • COM - Microsoft [1993] • DCOM, COM+, OLE, ActiveX • CORBA - 700+ companies. • implementations “ORBs”: Iona Orbix, IBM SOM • OpenDoc • JavaBeans - Sun MIT IAP 1999
Component basics • Interfaces, interface description languages, type libraries • Interoperability • Dynamic invocation (late binding) • Naming • Versioning • Persistence • Lifecycle management MIT IAP 1999
Interfaces • Contract between client and implementation • abstraction • COM/CORBA objects != C++ objects • Example: IUnknown QueryInterface(CLSID, IID) AddRef() Release() • Interface inheritance • Multiple interfaces per component interface interface COM object interface MIT IAP 1999
Interface descriptions • Interface description languages • COM IDL, CORBA IDL • type libraries • Reflection • preserve compile-time information for run-time inspection • Java, COM+ • Dynamic invocation MIT IAP 1999
Interoperability • COM: binary standard • C++ vtable • CORBA: standardized language bindings • Location transparency: stubs & proxies • same code for: in-process, out-of-process, remote • marshalling RPC MIT IAP 1999
Dynamic invocation • Late binding: scripting • Need dynamically built stubs, proxies, type checking • COM: dispatch interfaces • an interface with only one method: Invoke • method selected with dispatch id (DISPID) MIT IAP 1999
Naming • How name components, interfaces, objects? • GUID or UUID - globally unique identifier • COM: 128 bit number • Java: hierarchical naming scheme • Directory: registry, interface repository MIT IAP 1999
Versioning • Major, Minor version numbers: 5.1.32 • passing object references? • COM: • immutable interfaces • IIDs can be generic • CoTreatAsClass - IID redirection MIT IAP 1999
Persistence • Example: save a compound document • Filesystem within a file • “Structured storages” (COM) • Related: serialization, externalization MIT IAP 1999
Lifecycle management • Reference counting • COM: IUnknown Addref, Release • Automatic garbage collection (JavaBeans) • Remote liveliness: • PING protocol MIT IAP 1999