Go Spring.net Introduction

Source: Internet
Author: User

Transferred from: http://www.cnblogs.com/cilence/archive/2013/02/21/2920478.html

spring.net:http://www.springframework.net/

The major mainstream. NET IOC Framework performance test comparison http://www.cnblogs.com/liping13599168/archive/2011/07/17/2108734.html

Comparison of Castle IOC container and spring.net configuration http://terrylee.cnblogs.com/archive/2006/04/25/384149.html

1.1 Overview

The long test that spring has experienced in the Java community is already a very mature and stable framework. And Spring.net's predecessor was the Java version of spring. Spring.net is based on the Java version of the spring framework, porting the concepts and programming ideas of Spring (Java Edition) to the. NET Platform.

Spring.net is an application framework that is designed to help software developers create enterprise-class. NET application. It provides many aspects of functionality, such as dependency injection, aspect-oriented programming (AOP), data access abstraction, and ASP.

The Spring.net framework is a lightweight, open-source framework for enterprise-class applications. Spring.net is not only open source, but Spring.net also offers a number of features that can be accomplished by almost 80% of the software process. While the Spring.net feature is numerous, the use of spring.net is negligible for our application consumption, and it is non-intrusive (almost all functions can be managed through a configuration file, and developers can use the Spring.net function module or multiple function modules at the same time. The Spring.net framework is known as a lightweight, open-source framework for enterprise applications that can be done only through configuration and without affecting the original development method in the Spring.net function module.

1.2 how we developed software before

In enterprise applications are generally very complex, unlike the XX management system that we used to develop in school. In enterprise applications, we typically use a three-tier structure (a multilayer structure) to divide the application into several functional layers. such as the data access layer, the business logic layer, the presentation layer, and so on. For example, the layer needs to call the method of the business logic layer, the business logic layer needs to call the data Access layer method, the data access layer needs to access the database. Regardless of how the application is built, it is ultimately an object that works together (calls between layers). Together, these objects form the complete application (the software we develop). So we've been saying that there is interdependence between objects and objects in software. When the software is complex to a certain extent (enterprise application is very complex), if the software architecture is not good, the dependencies between the layers are too strong, this time when the demand changes, we can not allow our software to adapt to these changes, and ultimately lead to our software abortion.

Microsoft. NET platform provides a rich set of capabilities for building software. From primitive types to base class libraries, to fully functional WinForm and ASP. NET Framework. But it may be due to the fact that there was no open source before. NET community has not grown up. The. NET platform itself does not provide any way to manage the business logic and organize them in an appropriate way, previously only for architects or developers to create applications. But in our country it is true that talent is limited, and good architects are not every team.

It is true that there are many design patterns available for the design of the business domain, and we use these design patterns to build our software by combining classes or objects better. Such as: factories, abstract factories, builders, decorators, and proxy models have been widely accepted and adopted by today's software development industry (which may be why these design patterns have long been stereotyped as models, and in the 90 's Gof published the book "Design patterns: The basis of reusable object-oriented software"), These patterns are good, most of them are stereotyped named programming methods, which generally say, in what circumstances to use, can solve what problems.

1.3 spring.net The problem that is solved

Spring.net is a set of business logic Layer framework, which plays a connecting role in our software development (on the presentation layer, the data access layer). Design patterns are used extensively in spring.net, and if we use the Spring.net framework appropriately in software development, developers are better able to harness our applications and improve development efficiency without having to reach the architect's level.

In Spring.net's IOC (Inversion of control: later in detail) the container solves the problem of how to effectively synthesize classes and objects and service groups into applications in an enterprise-class application. IOC containers through orthodoxy (orthodoxy means that these methods have been tested by the industry for many years and have been stereotyped as the best programming mode for design) to combine dispersed components or classes and objects into complete applications. Spring.net them together effectively. Spring.net greatly reduces the coupling between the levels, separating the concerns (the way we used to focus on data access, page logic, and so on) gives developers more focus on business logic. It provides the foundation for us to create scalable, maintainable software.

1.4 background

At the beginning of 2004, Martin Fowler once asked his website readers: "The question is, when we talk about inversion of control, what kind of controls are they reversing?" ”。 Then Fowler suggested renaming the control reversal (or at least giving it a more self-descriptive name), so the term dependency injection (Dependency injection) was used. Fowler also discusses some of the concepts behind the control inversion and dependency injection principles in the paper. If you need to know the authentic IOC and di theory, you can refer to this article: http://martinfowler.com/articles/injection.html.

1.5 Control reversal VS Dependency Injection

Inversion of Control (IOC) and Dependency Injection (DI), in fact, they are different angles of the same concept of description, because the concept of inversion of control (perhaps only understood as a container control object this level, it is difficult to think of who to maintain the object relationship), so the 2004 master-level figure Martin Flower also gave a new name: "Dependency Injection", relative control inversion, "dependency Injection" also describes the injected object depends on the IOC container configuration since the object.

Here's a special section to help us understand what control inversion and dependency injection are.

1.6 spring.net overall structure and modules

( Figure 1 The overall structure of the spring.net framework: This figure is from the spring.net official website)

The Spring.net framework includes a number of features that are well organized into a series of modules, as shown in. Spring.net 1.0 includes the complete IOC container and the AOP class library. Version 1.1 will be added to the Web, ORM, and data modules. Spring.net's download package does not contain modules that are integrated with other class libraries (such as Nhibernate,tibco Ems,anthem, and iiop.net) and can be downloaded separately if required. Each core module of the spring.net. The shades of gray are already available in version 1.0, and other modules will be released in a future release. These new modules can now be downloaded separately from the official website of Spring.net.

(1) Spring.core:

As the basis of the whole framework, it realizes the function of dependency injection. Most modules of spring.net depend on or extend the module. The Spring.core is based on the Iobjectfactory interface, which implements the factory pattern in a simple and elegant way, allowing us to not write the singleton type and numerous service locators ourselves, and to decouple the object configuration and its dependencies from the specific program logic. The Iapplicationcontext interface in this module is an extension of the iobjectfactory, adding many enterprise-class features, including text localization using resource files, event propagation, and resource loading, among others.

(2) SPRING.AOP:

Provides aspect-oriented programming (AOP) support for business objects. AOP improves the capabilities of the IOC container and lays a solid foundation for creating enterprise applications and using declarative services.

(3) spring.web:

A series of feature extensions for ASP, including dependency injection on ASP. NET pages, bidirectional data binding, using the master page in ASP. NET 1.1, and enhanced localization feature support.

(4) spring.services:

Allows any "normal" object (meaning an object that does not inherit any of the specified base types) to be published as an enterprise service (COM +) or remote object. This module enables the use of features such as dependency injection and feature metadata overrides. NET Web services to gain great flexibility. Windows backend services are also supported.

(5) spring.data:

Defines an abstract data access layer that allows data access across a variety of data access technologies, from ADO to various ORM. The module contains an abstract layer of ADO, which reduces the amount of work required for encoding and transaction management with traditional ADO.

(6) spring.orm:

Provides an integration layer for today's popular ORM class libraries (such as Nhibernate, ibatis.net, etc.), which includes declarative transaction management and many other features.

Go Spring.net Introduction

Related Article

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.