Component Requirements

March 15, 2008 at 10:05 am (COM, Unit 5) ()

Component Requirements

The advantage of using components result directly from their ability to dynamically plug into and unplug from an application. In order to achieve this capability , components must meet two requirements.

1.       Components must link dynamically

2.       Components must hide (or encapsulate) the details of how they were implemented.

1.       Dynamic Linking

·         The ultimate goal of this is to have an end user replace components in an application while that application is running.

·         Support for changing components at run time requires the ability of dynamically link components together.

·         In distributed environment there is no assurance that the component will be idle for modification. So, components should have facility to update or replace them while it is used by other system in the network.

2.       Encapsulation

·         A program or a component that uses another component is called the client. A client is connected to a component through an interface.

·         If the component changes without changing the interface, the client doesn’t have to change. Similarly, if the client changes without changing the interface, the component doesn’t have to change.

·         However, if changing either the component or the client changes the interface, the other side of the interface must also change.

·         Therefore, to take advantage of dynamic linking, components and clients must strive not to change their interfaces. They must be encapsulated.

·         The more the interface is isolated from implementation details, the less likely the interface will change as a result of changing the client or the component.

·         If the interface doesn’t change, changing a component will have little effect on the rest of the application.

Isolating the client from the component’s implementation puts some important constraints on the component. The following is a list of these constraints.

1.       The component must hide the computer language used for its implementation. Exposing the implementation language creates new dependencies between the client and the component.

2.       Components must be shipped in a binary form. If components are to hide their implementation language, they must be shipped already compiled, linked and ready to use.

3.       Components must be upgradable without breaking existing users. New versions of a component should work with both old and new clients.

4.       Components must be transparently relocatable on a network. A component and the program that uses it should be able to run in the same process, in different processes, or on different machines. The client should be able to treat a remote component the same way it treats a local component.

Post a Comment

You must be logged in to post a comment.