ABP框架系列之七:(About-关于ABP)

ASP.NET Boilerplate is designed to help us to develop applications using best practices without repeating ourselves. DRY - Don't Repeat Yourself! is the key idea behind ASP.NET Boilerplate.

ASP.NET样板的设计是为了帮助我们使用最佳实践不重复自己开发的应用。不要重复你自己!在ASP.NET的样板的核心理念。

All applications have some common problems and need to some common structures. ASP.NET Boilerplate is proper from small applications to large enterprise web applications to accomplish fast startups and maintanable code bases.

所有应用程序都有一些常见的问题,需要一些常见的结构。ASP.NET的样板是适当的从小型应用到大型企业的Web应用程序,实现快速启动和可维护的代码库。

Considerations(注意事项

Here, a list of concepts those are in mind while developing ASP.NET Boilerplate.

在这里,很多重要的概念需要注意在开发ASP.NET样板的时候。

Modularity(模块化

It should be easy to share entities, repositories, services and views between web applications. They should be packaged into modules and can be easily distributed (preferred as public/private nuget packages). Modules may depend on and use other modules. We should be able to extend models in a module for our application needs.

Modularity provides us "code re-usability" (DRY!). For example, we may develop a module that contains user management, role management, login page, error pages... Then all of these can be shared by our different applications.

在Web应用程序之间共享实体、存储库、服务和视图应该是很容易的。他们应该被封装成模块,可以很容易地分布(首选公共/私人NuGet包)。模块可以依赖和使用其他模块。我们应该能够在模块中扩展模型以满足应用程序的需要。

模块化为我们提供了“代码重用性”例如,我们可以开发一个模块,其中包含用户管理、角色管理、登录页面、错误页面…然后所有这些都可以由不同的应用程序共享。

Best practices

An application should be developed by considering best practices in software development. Using dependency injection is one of the most important subjects in this area. Should use AOP (Aspect Oriented Programming) where it's needed and possible, especially for cross-cutting concerns. It should correctly use architectural patterns such as MVC and MVVM. Also, it should follow the SOLID principles in whole application.

应该考虑软件开发中的最佳实践来开发应用程序。使用依赖注入是该领域最重要的课题之一。应该在需要和可能的情况下使用AOP(面向方面编程),特别是横切关注点。应正确使用建筑模式如MVC,MVVM。同时,应遵循整体应用的SOLID原则。

Following best practices makes our code-base more understandable and extensible. It also prevents us to fall in common mistakes those are experienced before by other people.

遵循最佳实践使我们的代码库更易于理解和可扩展。它也能防止我们犯别人以前所犯的错误。

Scalable code base(可扩展的代码库

Architecture of an application should provide (even enforce) a way of keeping a maintainable code base. Layering and modularity are main techniques to accomplish that. Also, following best practices is important. Otherwise the application gets complicated when it grows. We know, there are many applications are re-written from zero just since it's too hard to maintain the code base (DRY!).

应用程序的体系结构应该提供(甚至强制)保持可维护代码基的方法。分层和模块化是实现这一目标的主要技术。此外,遵循最佳实践是很重要的。否则,应用程序会变得复杂。我们知道,有很多应用程序是从零重新编写的,因为它太难维护代码库。

Libraries & frameworks(库和框架

An application should use and combine useful libraries & frameworks to accomplish well-known tasks. Should not try to re-invent the whell if an existing tool meets it's requirements. It should concentrate to it's own job (to it's own business logic) as much as possible. For example, it may use EntityFramework or NHibernate for Object-Relational Mapping. May use AngularJs or DurandalJs as Single-Page Application framework.

Like or don't like it, today we need to learn many different tools to build an application. Even it's more complicated for client side. There are much more libraries (thousands of jQuery plug-ins for instance) and frameworks there. So, we should carefully choice libraries and adapt to our application.

ASP.NET Boilerplates composes and combines best tools for you while it preventing you from using your own favourite tools.

应用程序应该使用和组合有用的库和框架来完成众所周知的任务。不应试图重新发明车轮如果现有的工具,满足它的要求。它应该尽可能地专注于自己的工作(它自己的业务逻辑)。例如,它可能使用NHibernate EntityFramework或对象关系映射。可以使用AngularJS或durandaljs单页面应用程序框架。

喜欢或不喜欢,今天我们需要学习许多不同的工具来构建一个应用程序。即使是客户端也比较复杂。有更多的库(例如,数以千计的jQuery插件)和框架。因此,我们应该谨慎选择库并适应我们的应用。

ASP.NET Boilerplates撰写的,结合了最佳的工具为你而阻止你使用你自己喜欢的工具。

Cross-cutting concerns(横切关注点

Authorization, validationerror handlinglogging, caching... are common stuffs all applications implement in a some level. These codes should be generic and shared by different applications. It also should be seperated from business logic code and should be automated as much as possible. This allows us to more focus on our application specific business logic code and prevents us to re-think same stuff again and again (DRY!).

错误处理、验证、授权、日志、缓存,都是在同一个水平上所有应用实现的普通的东西。这些代码应该是通用的,并且由不同的应用程序共享。它也应该与业务逻辑代码分离,并尽可能地自动化。这使我们能够更专注于特定于应用程序的业务逻辑代码,并防止我们一次又一次重新思考相同的东西。

More automation(更多的自动化)

If it can be automated, it should be automated (at least in most case). Database migrations, unit tests, deployments are some of the tasks those can be automated. Automation saves our time in a long term (even in middle term) and prevents from mistakes of manual tasks (DRY!).

如果它可以自动化,它应该是自动化的(至少在大多数情况下)。数据库迁移、单元测试、部署是自动化工作的任务之一。自动化可以节省我们的时间(即使是在中期),防止手工作业出错

Convention over configuration(约定优于配置

Convention over configuration is a very popular principle. An application framework should implement defaults as much as possible. It should be easier when following conventions but also should be configurable when needed.

约定优于配置是一个非常流行的原则。应用程序框架应该尽可能地实现缺省值。当遵循约定时应该更容易,但也应该在需要时进行配置。

Project startup(项目启动)

It should be easy and fast to start a new application. We should not repeat some tedious steps to create an empty application (DRY!). Project/Solution templates is a proper way of doing it.

启动一个新的应用程序应该很容易也很快。我们不应该重复一些繁琐的步骤来创建一个空的应用程序,项目/解决方案模板是一种合适的方法。

Source codes(源代码

ASP.NET Boilerplate is an open source project developed under Github.

Contributors(贡献者

ASP.NET Boilerplate is designed and developed by Halil İbrahim Kalkan. There are also contributors on github. You can also fork repositories and send pull requests.

Contact(联系

For your questions and other discussions, use official forum.

For feature requests or bug reports, use Github issues.

For personal contact with me, use my web page.

原文地址:https://www.cnblogs.com/smileberry/p/7903041.html