How anexsoft/asp.net-mvc-5-arquitectura-base works
Main Components
• FrontEnd (Project "01-FrontEnd"): This is the ASP.NET MVC 5 UI layer, which includes controllers, views, view models, route configurations, and front-end assets (managed via Bower for libraries like Bootstrap, jQuery, and Font Awesome). It also integrates ASP.NET Identity for authentication.
• Service Layer (Project "02-Service"): This layer contains business logic. There are at least two service projects here – one focused on authentication (“Auth.Service”) and another for general services (e.g., CourseService, StudentService, UserService). This layer bridges the presentation and data access layers.
• Persistence Layer (Project "03-Persistence"): This includes the database context, mappings, migrations, repository patterns, and also a separate project for managing DbContext scopes. This layer abstracts data access and enforces the Repository Pattern.
• Common Utilities (Project "04-Common"): This project holds shared code – helper classes (such as CurrentUserHelper, ResponseHelper), custom filters (like SoftDeleted), extensions (for DateTime, String, etc.), and dependency injection configurations (using LightInject), which are available across the solution.
• Unit Testing (Project "05-UnitTest"): Contains tests that validate the functionality across these layers.
Component Relationships and Data Flows
• The FrontEnd interacts with the Service Layer by making calls (either via internal service classes or Web APIs) from controllers.
• The Service Layer encapsulates the business logic and, in turn, calls the Persistence Layer’s repositories to read/write data.
• The Persistence Layer manages database connections and data operations using EF (Entity Framework) and supports mapping (defined in separate mapping files) and migrations.
• Both the FrontEnd and Service layers may also utilize elements from the Common Utilities for tasks like dependency injection, logging (NLog), user auditing, and parameter configuration.
• The Unit Test project touches different components by testing common utilities, business logic (service classes), and even parts of the data access layer.
Important Architectural Patterns and Technologies
• MVC Pattern in the FrontEnd (with Controllers, Views, and ViewModels).
• Layered Architecture/Separation of Concerns: Presentation (FrontEnd), Business Logic (Service), Data Access (Persistence), and Shared (Common).
• Repository Pattern in the Persistence Layer.
• Dependency Injection (using LightInject) across the solution to ensure loose coupling.
• ASP.NET Identity for authentication and authorization.
• Front-end dependency management via Bower.
• Logging using NLog.
• Automated unit testing for quality assurance.
• Automatic Parameters and SoftDeleted functionality integrated into common filters or helper functions.
Final Advice for the Principal Software Engineer
• Be detailed: capture the specifics such as the role of ASP.NET Identity, repository patterns, and external library management through Bower.