Download presentation
Presentation is loading. Please wait.
1
4. Component-based Architecture
2
Component Technology. Introduction
3
Modularity Maximizing reuse complicates use - Design Patterns
- Modularity Patterns 3
4
Objective Large distributed systems development cost reduction implies: Programming by assembly (manufacturing) rather than development (engineering) Reduced skills requirements Focus expertise on domain problems Improving software quality
5
Component Based Development for Complex Systems
6
Architectural Consequences of These Requirements:
Software should not be designed as monolithic unit but partitioned into composable services that can be spontaneously connected and orchestrated by business/technical processes (component-based software). „Software entropy“ should be maximized: loosely coupling between peers, decentralized information access, Just-in-Time Integration
7
Application Partioning
Solutions consist of collections of components. Components are divided into multiple packages. Packages can work with each other across a network through Object Request Broker (ORB). This application partitioning is transparent to the component developer.
8
No Assumption on Deployment
9
A Component: Represents a logical entity.
Encapsulates some coherent functionality. May be tested independently. May be part of a larger piece of software. Has well-defined provided and required interfaces for access to its functionality and for interoperability with other components. Provides a well-defined and documented configuration interface for the adaptation to a given environment. Is compliant with a contract specifying interfaces and quality attributes for the component.
10
Definitions of “Component”
11
Definitions of “Component”
12
Are Objects Components??
13
Blackbox Composition
14
Procedure Systems
15
Modules
16
A Linker is a Composition Operator that Composes Modules
17
What Components Provide The Parts of a Component
Set of classes providing interfaces Manifest Properties Methods in the form of methods, published in interfaces Reactions to Events Ability to provide information about themselves
18
Manifests Identification of the component Authorship of the component
List of files or classes making up this component Other components on which this one relies Encryption information Means of verifying that all parts of the component are present Version number
19
Component Technologies
Microsoft COM+/MTS Windows-specific Component Technology. OpenDoc Parts Gone with the Wind! JavaBeans/Enterprise JavaBeans Java-based Component Technology. JavaSoft’s answer to MTS/COM+.
20
.NET - The Microsoft Way
21
Sun ONE (Open Net Environment)
22
You Need “Glue” How to connect (remote) components and applications:
Binary objects (components) as distribution units. Distributed Component Models - not limited to the boundaries of a process or network node. Homogeneous APIs on top of heterogeneous systems for encapsulating system details. Remote Method Invocation paradigm. Straight-forward integration of legacy code using bidirectional adapters.
23
MS Component Technologies
24
COM Principles Rigorous Encapsulation Polymorphism
Black box -- no leakage of implementation details All object manipulation through strict interfaces Polymorphism via multiple interfaces per class “Discoverable”: QueryInterface
25
COM Runtime Architecture
Pluggable Transports Client Machine Server Machine Component COM Client TCP Proxy COM Runtime COM Runtime HTTP Other Component
26
What is ActiveX? A marketing name for a set of technologies and services, all based on COM (the model, the “ORB”, and the services)
27
Active Components ActiveX Controls
Are COM components with “design-time” UI Can be written in C++, VB, Delphi, ... Self-registering Optimized for download and execute Work on both Active Client or Server Can talk indirectly over HTTP or directly over COM
28
COM (Common Object Model)
liidesed (= lepingud) kapseldus (meetodid, omadused, sündmused) QueryInterface – multiversionaalsus Binaarstandard (C++, VB, ...) DCOM (distributed) – asukoha läbipaistvus
29
MS Component Technologies:
DLL (Dynamic Link Library) OLE (Object Linking and Embedding) COM (Common Object Model) ActiveX MTS (Microsoft Transaction Server) MSMQ (Microsoft Message Queue) COM+ Windows DNA (Distributed interNet Application) CLR (Common Language Runtime)
30
MS Component Technologies
.net
31
Evolution of Component Architectures
32
.NET
33
.NET-protsessid
34
Visual Studio.NET Language Architecture
C++ to IL Translator IL Assemblies C++ Code VB to IL Translator IL VB Code IL = Intermediate Language
35
Visual Studio.NET Language Architecture
Common Language Runtime (CLR) Assemblies JIT Compiler System Services
36
Visual Studio.NET The IL Early Compiler
Common Language Runtime (CLR) Assemblies Early Compiler System Services
37
Compilation Process in .NET
Base class library Compilation Process in .NET Ancillary info Compiler & metadata generator IL and metadata Class loader Source Code .dll or .exe C++ VB C# IL compiler J#, Java (3rd parties) native code Process Key: File execute
38
The Parts of a .NET Assembly (Component)
Source Files A .NET assembly: xyz.dll Manifest Identity name version Names of files Encrypted hash of files to ensure integrity Specification of types defined Names of referenced assemblies Specification of required security permissions A File Microsoft Intermediate Language (IL) A File A File A File
39
Common Language Runtime (CLR)
.NET-käituskeskkond haldab programmi käituse (execution management) tagab teenused (provides services) Hallatud kood (managed code), tagab keeltevahelise: integratsiooni (cross language integration) versioonihalduse automaatse mäluhalduse isekirjelduvad objektid (IDL-i pole vaja) ”Compile once, run verywhere” ...
40
CLR - metaandmed Kompilaatorid loovad koos koodiga ka metaandmed, mis:
kirjeldavad komponente, objekte ja käitustingimusi (klasside asukoht ja laadimine, koodi genereerimine, käituskontekst, ...) tagavad automaatse objektide eluea (garbage collection) CLRi toetavad: Visual Basic, C#, Visual C++, Perl (¬MS), COBOL (¬MS) Common Language Specification (CLS)
41
CLR - MSIL
42
CLR - JIT Osa programmi ei täideta konkreetses käituses MSIL-kood konverteeritakse masinakoodiks ja laaditakse mällu vaid siis, kui vaja Laadur loob igale meetodile vahendaja (stub) Järgnevad pöördumised suunatakse juba loodud masinakoodi poole Konverteerimisel verifitseeritakse koodi metaandmeid kasutatades – safe code
43
COM vs CLR COM võimaldab erinevates keeltes kirjutatud komponentide interaktsiooni, koostööd CLR integreerib keeled ja võimaldab ühe keele objektidel kasutada teises keeles kirjutatud objekte – Common Language Specification (CLS)
44
Java Architecture
45
Java Architecture Network .java .class load load load Browser
file Compiler .java byte codes .class load JVM load java byte code os/hardware JVM std libs load Browser java byte code os/hardware JVM std libs APPLICATION APPLET
46
Java to byte code Java byte code Java to byte code Translator
Java Code
47
Java Virtual Machine Java Virtual Machine (JVM) Java byte code
JIT Compiler System Services
48
Java – the Byte Code Early Compiler
Java Virtual Machine (JVM) Byte Code Early Compiler System Services
49
Component and deployment diagrams
50
Component Diagram
51
Component Diagrams
52
Component Notation A component is shown as a rectangle with
A keyword <<component>> Optionally, in the right hand corner a component icon can be displayed A component icon is a rectangle with two smaller rectangles jutting out from the left-hand side This symbol is a visual stereotype The component name Components can be labelled with a stereotype there are a number of standard stereotypes ex: <<entity>>, <<subsystem>>
53
Component Diagram
54
Component Elements A component can have Interfaces Usage dependencies
An interface represents a declaration of a set of operations and obligations Usage dependencies A usage dependency is relationship which one element requires another element for its full implementation Ports Port represents an interaction point between a component and its environment Connectors Connect two components Connect the external contract of a component to the internal structure
55
Interface A component defines its behaviour in terms of provided and required interfaces An interface Is the definition of a collection of one or more operations Provides only the operations but not the implementation Implementation is normally provided by a class/ component In complex systems, the physical implementation is provided by a group of classes rather than a single class
56
Interface May be shown using a rectangle symbol with a keyword <<interface>> preceding the name For displaying the full signature, the interface rectangle can be expanded to show details Can be Provided Required
57
Interface A provided interface
Characterize services that the component offers to its environment Is modeled using a ball, labelled with the name, attached by a solid line to the component A required interface Characterize services that the component expects from its environment Is modeled using a socket, labelled with the name, attached by a solid line to the component
58
Interface Where two components/classes provide and require the same interface, these two notations may be combined The ball-and-socket notation hint at that interface in question serves to mediate interactions between the two components If an interface is shown using the rectangle symbol, we can use an alternative notation, using dependency arrows
59
Port Specifies a distinct interaction point
Between that component and its environment Between that component and its internal parts Is shown as a small square symbol Ports can be named, and the name is placed near the square symbol Is associated with the interfaces that specify the nature of the interactions that may occur over a port
60
External View A component have an external view and an internal view
An external view (or black box view) shows publicly visible properties and operations An external view of a component is by means of interface symbols sticking out of the component box The interface can be listed in the compartment of a component box
61
Internal View An internal, or white box view of a component is where the realizing classes/components are nested within the component shape Realization is a relationship between two set of model elements One represents a specification The other represent an implementation of the latter
62
Internal View The internal class that realize the behavior of a component may be displayed in an additional compartment Compartments can also be used to display parts, connectors or implementation artifacts An artifact is the specification of a phisycal piece of information
63
Internal View Components can be built recursively
64
Deployment Diagrams There is a strong link between components diagrams and deployment diagrams Deployment diagrams Show the physical relationship between hardware and software in a system Hardware elements: Computers (clients, servers) Embedded processors Devices (sensors, peripherals) Are used to show the nodes where software components reside in the run-time system
65
Deployment Diagram Describes the configuration of hardware in a system in terms of nodes and connections Describes the physical relationships between software and hardware Displays how artifacts are installed and move around a distributed system
66
Deployment Diagrams Deployment diagram Contains nodes and connections
A node usually represent a piece of hardware in the system A connection depicts the communication path used by the hardware to communicate Usually indicates the method such as TCP/IP
67
Deployment Diagrams Deployment diagrams contain artifact An artifact
Is the specification of a phisycal piece of information Ex: source files, binary executable files, table in a database system,…. An artifact defined by the user represents a concrete element in the physical world
68
Deployment Diagrams An artifact manifest one or more model elements
A <<manifestation>> is the concrete physical of one or more model elements by an artifact This model element often is a component A manifestation is notated as a dashed line with an open arrow-head labeled with the keyword <<manifest>>
69
Deployment Diagrams
70
A Statement of Charles Darwin
Similar presentations
© 2025 SlidePlayer.com Inc.
All rights reserved.