ContentsIntroduction

We are creating various applications based on different needs. But implementing common and similar structures over and over again, at least at some level. Authorization, Validation, Exception Handling, Logging, Localization, Database Connection Management, Setting Management, Audit Logging are some of these common structures. Also, we are building architectural structures and best practices like Layered and Modular Architecture, Domain Driven Design, Dependency Injection and so on. And trying to develop applications based on some conventions.

Since all of these are very time-consuming and hard to build seperately for every project, many companies create private frameworks. They're developing new applications faster with less bugs using these frameworks. Surely, not all companies are that lucky. Most of them have no time, budget and team to develop such frameworks. They might not even be able to create a framework, it's hard to document and train developers and maintain it.

ASP.NET Boilerplate (ABP) is an open-source and well documented application framework that began the idea of "developing a common framework for all companies and all developers!" It's not just a framework but also provides a strong architectural model based on Domain Driven Design and best practices in mind.

A Quick Sample

Let's investigate a simple class to see ABP's benefits:

  1. public class TaskAppService : ApplicationService, ITaskAppService
  2. {
  3. private readonly IRepository<Task> _taskRepository;
  4. public TaskAppService(IRepository<Task> taskRepository)
  5. {
  6. _taskRepository = taskRepository;
  7. }
  8. [AbpAuthorize(MyPermissions.UpdatingTasks)]
  9. public async Task UpdateTask(UpdateTaskInput input)
  10. {
  11. Logger.Info("Updating a task for input: " + input);
  12. var task = await _taskRepository.FirstOrDefaultAsync(input.TaskId);
  13. if (task == null)
  14. {
  15. throw new UserFriendlyException(L("CouldNotFoundTheTaskMessage"));
  16. }
  17. input.MapTo(task);
  18. }
  19. }

Here, we see a sample Application Service method. An application service, in DDD, is directly used by the presentation layer to perform use cases of the application. We can think that the UpdateTask method is called by JavaScript via AJAX. Let's see ABP's some benefits here:

We can see the benefits of ABP in such a simple class. All these tasks normally require a significiant amount of time, but they are all automatically handled by ABP.

What Else

Beside this simple example, ABP provides a strong infrastructure and application model. Here, some other features of ABP are:

Startup Templates

Starting a new solution, creating layers, installing Nuget packages, creating a simple layout and a menu. All these are very time consuming stuff.

ASP.NET Boilerplate provides pre-built startup templates that make starting a new solution much easier. Templates support Single-Page Application (SPA) and Multi-Page MVC Application (MPA) architectures. Also, allows us to use various ORMs.

How To Use

ASP.NET Boilerplate is developed on Github and distributed on Nuget. The easiest way to start with ABP is to create a startup template and follow the documentation.