Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Building Enterprise Apps with ASP.NET Core 2.1

4,531 views

Published on

The explosive growth of web frameworks and the demands of users have changed the approach to building web applications. Many challenges exist, and getting started can be a daunting prospect. Let's change that now.

This talk provides practical guidance and recommendations. We will cover architecture, technologies, tools, and frameworks. We will examine strategies for organizing your projects, folders and files. We will design a system that is simple to build and maintain - all the way from development to production. You leave this talk inspired and prepared to take your enterprise application development to the next level.

Published in: Software
  • Be the first to comment

Building Enterprise Apps with ASP.NET Core 2.1

  1. 1. Enterprise Software Development Join the Conversation #EnterpriseApps #AspNetCore @JasonGtAu
  2. 2. Enterprise Apps with ASP.NET Core 2.1 .NET User Group Tour – June 2017 Join the Conversation #EnterpriseApps #AspNetCore @JasonGtAu
  3. 3. SSW Solution Architect Jason Taylor @JasonGtAu @SSW_TV codingflow.net github.com/JasonGT Developer* Since 1992 1 MHz CPU 20 KB Memory Join the Conversation #EnterpriseApps #AspNetCore @JasonGtAu
  4. 4. Architecture & Design Persistence Layer Application Layer Infrastructure Layer Presentation Layer Domain Layer Agenda
  5. 5. Architecture & Design Join the Conversation #EnterpriseApps #AspNetCore @JasonGtAu
  6. 6. Independent of frameworks Testable Independent of UI Independent of database Independent of external agency Join the Conversation #EnterpriseApps #AspNetCore @JasonGtAu Application Domain Presentation Clean Architecture
  7. 7. Unit of Work and Repository Patterns Should we implement these patterns? It isn’t always the best choice, because: • DbContext insulates your code from database changes • DbContext acts as a unit of work • DbSet acts as a repository • EF Core has features for unit testing without repositories Join the Conversation #EnterpriseApps #AspNetCore @JasonGtAu
  8. 8. Independent of frameworks* Testable Independent of UI Independent of database Independent of external agency Join the Conversation #EnterpriseApps #AspNetCore @JasonGtAu Application Domain Presentation Clean Architecture
  9. 9. Key Points Domain contains enterprise-wide types and logic Application contains application-specific models and logic Infrastructure (including Persistence) contain all external concerns Presentation contains frontend apps Infrastructure and Presentation components can be replaced with minimal effort Join the Conversation #EnterpriseApps #AspNetCore @JasonGtAu
  10. 10. Domain Layer Join the Conversation #EnterpriseApps #AspNetCore @JasonGtAu
  11. 11. Overview Entities Value Objects Enumerations Logic Exceptions Join the Conversation #EnterpriseApps #AspNetCore @JasonGtAu Application Domain Presentation
  12. 12. Demo Reviewing the Domain layer Join the Conversation #EnterpriseApps #AspNetCore @JasonGtAu
  13. 13. Key Points Use data annotations sparingly Always define foreign keys Use value objects when appropriate Initialise all collections Create custom domain exceptions Join the Conversation #EnterpriseApps #AspNetCore @JasonGtAu
  14. 14. Application Layer Join the Conversation #EnterpriseApps #AspNetCore @JasonGtAu
  15. 15. Overview Interfaces Models Logic Validators Events Exceptions Join the Conversation #EnterpriseApps #AspNetCore @JasonGtAu Application Domain Presentation
  16. 16. Demo Reviewing the Application layer Join the Conversation #EnterpriseApps #AspNetCore @JasonGtAu
  17. 17. Key Points Use CQRS to simply your overall design Use MediatR to simplify management of requests / responses, commands, queries, notifications and events Know the difference between View Models (VMs) and Data Transfer Objects (DTOs) Use FluentValidation for complex validation scenarios Create custom application exceptions Join the Conversation #EnterpriseApps #AspNetCore @JasonGtAu
  18. 18. Persistence Layer Join the Conversation #EnterpriseApps #AspNetCore @JasonGtAu
  19. 19. Overview DbContext Configurations Migrations Seeding Abstractions Join the Conversation #EnterpriseApps #AspNetCore @JasonGtAu Application Domain Presentation
  20. 20. Demo Reviewing the Persistence layer Join the Conversation #EnterpriseApps #AspNetCore @JasonGtAu
  21. 21. Key Points Independent of the database Conventions over configuration Use Fluent API Configuration over Data Annotations Use an extension to automatically apply all entity type configurations Join the Conversation #EnterpriseApps #AspNetCore @JasonGtAu
  22. 22. Infrastructure Layer Join the Conversation #EnterpriseApps #AspNetCore @JasonGtAu
  23. 23. Overview Clients File Systems Email / SMS System Clock Anything External Join the Conversation #EnterpriseApps #AspNetCore @JasonGtAu Application Domain Presentation
  24. 24. Demo Reviewing the Infrastructure layer Join the Conversation #EnterpriseApps #AspNetCore @JasonGtAu
  25. 25. Key Points Contains classes for accessing external resources Implements interfaces within the Application layer Utilises DTOs defined within the Application layer No layers depend on Infrastructure layer, e.g. Presentation layer Join the Conversation #EnterpriseApps #AspNetCore @JasonGtAu
  26. 26. Presentation Layer Join the Conversation #EnterpriseApps #AspNetCore @JasonGtAu
  27. 27. Overview Web Forms MVC Razor Pages Web API Single Page Apps Join the Conversation #EnterpriseApps #AspNetCore @JasonGtAu Application Domain Presentation
  28. 28. Demo Reviewing the Presentation layer Join the Conversation #EnterpriseApps #AspNetCore @JasonGtAu
  29. 29. Key Points Controllers should not contain any application logic All application logic belongs in the application layer Utilising Open API bridges the gap between the frontend and backend Create and consume well defined view models Join the Conversation #EnterpriseApps #AspNetCore @JasonGtAu
  30. 30. Recommend Resources Join the Conversation #EnterpriseApps #AspNetCore @JasonGtAu
  31. 31. Northwind Traders A sample application built using ASP.NET Core and EF Core. bit.ly/northwind-traders Join the Conversation #EnterpriseApps #AspNetCore @JasonGtAu
  32. 32. Building Monoliths Clean Architecture Azure aka.ms/webappebook Join the Conversation #EnterpriseApps #AspNetCore @JasonGtAu
  33. 33. Building Microservices Microservices Containers DDD Azure aka.ms/microservicesebook Join the Conversation #EnterpriseApps #AspNetCore @JasonGtAu
  34. 34. Clean Architecture Robert C. Martin bit.ly/clean-architecture-book Join the Conversation #EnterpriseApps #AspNetCore @JasonGtAu
  35. 35. Questions? Join the Conversation #EnterpriseApps #AspNetCore @JasonGtAu
  36. 36. Thank you! info@ssw.com.au www.ssw.com.au Sydney | Melbourne | Brisbane

×