[Distributed computing environment learning notes] 3 Software Component Structure

Source: Internet
Author: User

Author: gnuhpc
Source: http://www.cnblogs.com/gnuhpc/

1. Basic concepts:

  • Framework: partially solves the problem by allowing users to integrate the component architecture.
  • Component (Component): a component is the basic unit of software. It is small enough for maintenance and must be large enough to provide functionality and can be packaged and used.
  • Object Bus: a mechanism that enables components and frameworks to call services of another component or framework in a distributed environment.

The component provides software units, and the framework assembles the components together to build many applications. The object bus extends the capabilities of the component and framework to the Development Network, allows millions of independent software units to seamlessly interact with each other in heterogeneous links.

2. Framework

A. Lead: inherent disadvantages of processes and class libraries: passive. They all require a structure that provides the actual control flow. A large number of applications, especially those in the same field, share similar structures. These structures have not been reused by common object-oriented technologies.

B. definition: The Framework determines the unchanged part of all problem set solutions in a certain field. Developers must add some changed code to the framework to grasp its actions, make the application a specific application in the domain.

C. Type:

  • Horizontal framework: applicable to various application fields, such as network security
  • Vertical framework: applicable to specific application fields, such as insurance and Billing

Framework Application Model: The Framework provides a unified solution for similar problem sets (grasping the application structure) and calls methods by framework (the components do not call each other). The components can be reused, the framework itself can also be reused by other applications in the same field.

3. Components)

A. definition: A software unit that is close to an independent and replaceable unit. It implements a clear function in a defined architecture context while complying with and providing physical implementations of a set of interfaces. A component is a function or structure unit and is a coarse-grained expression of the class. In English component, components are generated to solve the division of some functions and structures and make them reusable. Components organize some classes and interfaces to expose one or more interfaces for external calls. Complex components may also contain configuration files, interfaces, and dependent library files. components can also contain or use other components to form larger components.

B. features:

  • Self-description (introspection): A component must be able to identify its attributes, access methods, and events. This information allows the development environment to seamlessly integrate third-party software components;
  • Customizable: You can customize the feature value of the component and configure the component by yourself. This usually means that a graphical environment should be provided so that the attributes of components can be set through the control panel, so that developers can crop a general component, to meet the specific needs of certain environments.
  • Integration: developers can integrate components into the development environment and connect them to new applications. Simple components can be aggregated to obtain complex components. components can be directly controlled by programming languages. The component can also be connected to the scripting language or the environment that accesses the component from the code level, so that the software component can be used in non-visual development projects;
  • Connection Mechanism: components must be able to generate events or have other mechanisms that enable programmers to achieve mutual connection in terms of semantics. This means that the programmer can easily add code to the button, so that the buttons in the point can affect the actions of other components.
  • Plug-in-a ready-to-use software component that can be packaged and purchased from a dealer.
  • Maintenance-the components are small enough to facilitate maintenance and upgrade.
  • Feature-the component is large enough to work in the way it expects.
  • Feature-a component is designed to execute a specific task and represents a part of the entire application. This part can be fine particles, medium particles or large particles.
  • Path without direct communication with other components-non-direct communication is a necessary condition for component maintenance and upgrade. In addition, the component can be used in a distributed environment.
  • Self-descriptive-a component can describe the services it provides to the rest of the system. This type of description is usually provided through descriptive interface definition languages unrelated to the implementation.
  • The target framework-component is usually built for a special framework, which cannot be run in other frameworks. For example, Java Beans components cannot be directly used in ActiveX environments.
  • Target object bus-components directly connected to an object bus interface may not be used with another object bus. Gateways are used to provide interoperability between different object buses.

C. Component Interface: a set of operations used to specify the services provided by a component. Interface specifies the interaction mechanism between a component and other components. An interface is used to name an operation set and specify their tags and protocols. It only focuses on the behavior of a given service, rather than its structure. The interface does not provide any implementation for its operations.

D. Comparison between build and object:

Similarities:

Both provide an element for describing and constructing an application. An object is any identifiable entity in a problem domain. For example, an object can represent an employee or an order. In the analysis and design phase, objects are purely conceptual. in the implementation phase, objects are implemented in software. In component-based development, components also provide similar construction blocks. A developer regards an application as a set of components that interact with each other. When constructing an application, the actual component is constructed or integrated into the software. The final application will be composed of these components that work together. Objects and components are specified using similar technologies. An object is an instance of an object type, and the object type specifies the characteristics of the object. The concept of component type is very similar to that of object type (rather than the same. Not all components have the concept of type. A bean in Java Beans has the concept of type, but for example, components obtained after wrapper is packaged on a legacy system do not have the concept of type ). A specific component is an instance of the component type, and it displays its specified features.

Differences:

The component technology is developed from the object-oriented technology, but it is different from the object technology. In the component technology, it can be implemented either by the object-oriented technology or by the object-oriented technology. Object Technology is not necessary in component technology. Developers may use any non-object-oriented language and environment to implement components. In addition, components may include legacy systems that may be packaged to operate with component-based software. In object-oriented technology, inheritance, encapsulation, and polymorphism are three basic features of OO technology. However, in component technology, only encapsulation features are highlighted, that is, components are independent software units that can be delivered. Typically, a component provides more powerful functions than an object. Object and object type are basic components used for application development. Developers specify object types to include key domains and technical concepts. An application may contain hundreds of object types. On the contrary, an application may only contain several components. A component may contain multiple objects. A component provides an object-level component. A component can be seen as a method of organizing objects.

 

4. Object Bus

A. Definition: extend the capabilities of components and frameworks to the development network so that millions of independent software units can interact seamlessly in heterogeneous links.

B. Object bus language: a common language that can be understood by communication objects. All objects are provided with a mechanism to describe themselves to the bus. This mechanism is provided through a descriptive Interface Definition Language (IDL) unrelated to the implementation.

C. Example: The most famous object Bus: CORBA and DCOM.

 

5. component-based software development process

 

6. Component Model

A. Component Model: The Architecture and API set established for developers to define software components. This allows developers to build application systems through dynamic combinations of software components. Currently, the mainstream component models include CORBA, EJB, and COM (DCOM/COM +)

Component Model = component + container

  • Component-basic software components with reusable features
  • Containers: A group provides a series of accessible management services. As long as the components comply with container requirements (specifications), the container can allow the components to use the corresponding management services, the component must implement the API required by the container before it can run in the container. It is used to store and arrange components for interaction between components. (The container can also be used as a component of another container)

B. heavyweight framework:

A typical example is EJB. The developed system basically needs to be placed in a container system for running and the interface required by the container needs to be implemented. After the container instantiates the business object, it passes it to the context of the business object, and the business object itself needs to be located or pull out of other resources or business objects by means of JNDI. These containers are large in size, occupy resources, provide many internal services, and start slowly because they are basically targeted at large enterprise applications. There are many rules to be followed for development, and the development efficiency is relatively low. A large part of the time is spent on deploy and run processes, which makes debugging and testing difficult. Heavyweight frameworks show excellent performance when running on a large scale. The main disadvantage is low development efficiency.

C. Lightweight Framework:

Typical Example: Spring

  • Struts and webwork web-oriented framework
  • Hibernate for database ORM ing (ORM)

The decoupling mode represented by dependency injection does not allow components to depend on APIs in the container (runtime environment. Lightweight containers take the initiative to manage the inserted components through inversion control. As long as the components comply with the standards, they can be managed by lightweight containers. Components exist in the form of pojo (plain old Java objectexample. You only need java.exe to run it, and you can implement testing without a container. System development based on a lightweight framework is very rapid, but the performance may be worse than the heavyweight framework during large-scale operation.

 

7. Key Technical Points

It is not about how to make remote calls, RPC or RMI technology is enough to support, but the real technical focus is on how to simplify application development: Containers provide various services, further: lightweight Framework technology, loosely coupled with the relationship between component-based applications and containers, only integrate the required services. The relationship between components can also be established as needed.

 

Author: gnuhpc
Source: http://www.cnblogs.com/gnuhpc/

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.