IOC: Main Concepts

Source: Internet
Author: User

Question:
This is a translation from Castle's official site Documentation Center. It introduces the microkernel and facility in Castle around the basic concept of IOC. for friends of Windsor, carefully reading this article will give a clearer outline for subsequent studies. e good friends can directly look at the original text, address is: http://www.castleproject.org/index.php/IoC:Main_concepts above there are many goodArticleIf you have a friend who needs it, I will try again later. :) (please forgive me if the translation is not good, haha)

IOC: Main Concepts
A deep understanding of the container, especially the microkernel concept, will help you to use it skillfully, especially the extension.
Content Structure:
1. What is a container that controls reversal?
1.1 What is Castle's microkernel
2. Concept
2.1 service/component
2.2 Subsystem
2.3 facilities
2.3.1 new Semantics
2.3.2 Integration

What is a reverse control container?
The so-called control reversal container is a kind of tool that can register classes and act on them when appropriate-usually it is necessary to perform some useful work, otherwise it will be meaningless.

At the very bottom layer, containers connect them through dependencies between classes, which are generally called automatic assembly. But why are you doing this? This is only when you need to design a loosely coupled ApplicationProgramIt makes sense. If your design scheme is a standard pasta-like design, the reverse control container won't help you too much.

However, this article does not try to convince you of the benefits of the concept of IOC.

What is Castle's microkernel?
Microkernel is a specific implementation of the IOC container on Castle. It will be helpful to provide a set of "special" intersections, which will work on a series of components without affecting each other.
For example, you can use AOP, logs, and transaction processing for your components. your components do not need to care about their functions. At the same time, AOP does not interfere with logs and transactions. we call these packaged "Features" facilities. we will discuss them more later.

Concept
From the very beginning, we didn't plan to create a container that can support every scenario developers encounter. Instead, we invested all our energy in creating a lightweight and highly scalable container.
The extension mentioned here is not vertical extension as you create subclass to enrich the parent class. although you can do that, microkernel is designed to achieve vertical or horizontal scaling by replacing the key block or registering facilities.
It is important to recognize this key concept to understand the remaining documents before going into more specific details.

Service/component
A component is a small reusableCodeUnit. it only exposes and implements one service. in practical applications, a component is a class implemented from a service (interface. this interface is the service contract. Through these interfaces, we can build an abstract layer. When we replace the specific implementation of the service, no errors will be generated.

Subsystem
Subsystems are used by microkernel to operate some external things. For example, configuration and type conversion quilt system operations, they can be easily replaced or expanded to meet a certain requirement, just follow the contract.

Facilities
Facilities are unit extensions. it enhances container functionality, provides new semantics, and is often integrated with external tools or frameworks. we now have a set of facilities that you can use to learn more, especially by observing their implementations.

Xinyu
The following facilities are examples of new meanings added to microkernel:

  • Facility: typedfactory
  • Facility: startable

     

    Integration
    The following facilities are examples of integration solutions added to microkernel.

    • Facility: nhib.pdf
    • Facility: ibatisnet
    • Facility: Prevalence
    • Facility: aspectsharp
    • Facility: remotingfacility
    • Facility: Logging
  • 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.