ASP.NET Core 2: Architecture & Design Pattern Ideology
The need of more robust and interactive web experience is growing rapidly and so, is the need of more improved, simpler and developer friendly web technologies are rising in terms of making web development more productive, highly user-friendly & interactive and quicker to develop with less effort. Gone are those days when development of a website consumes a lot of time and expenses as everything needs to be done from scratch by yourself. Now a days, everything is available to a web developer and all that needs to build a website is understanding of the technology and the focus on more productive web development.
Today's demonstration is more theoretical than code base as I will try to elucidate ASP.NET Core 2 architecture and ideology behind some core design patterns being made part of the ASP.NET core 2 development templates.
So, in essences ASP.NET core creates necessary per-defined "N" tier/layers architecture for us developers automatically, which saves our time and effort to worry less about the complexity of necessary "N" tier/architecture of the web project and focus more on the business logic. In non-ASP.NET core environment, what happens in general that we as a developer are more focused on the business logic and the selection of best design patterns not on the architecture side because at the end of the day the final version of our web project is deployed on a single tier machine and we are more focused on managing the complexity of the project in terms of code re-usability and modular components but on a single tier, very few organizations/enterprises actually implement "N" tier/layer architecture to make their product more robust and modular as "N" tier/layer architecture requires more resources consumption, management for scaling the project as necessary and of course hiring of more skilled resources that can build the necessities.
No wonder you will find many modern web development frameworks more pre-build design pattern friendly rather that pre-build tier/layer friendly, for, that matter, a developer need to make the necessary tiers/layer himself/herself and no wonder MVC design pattern is the most popular for web development. Remember that design pattern and architecture are separate concepts, unfortunately, many senior developers refer design pattern and architecture as same, so, they refer MVC as architecture rather than design pattern. So, here comes ASP.NET core that brings the benefit of pre-build architectural framework that ease out tier deployment of the project along with providing pre-build Single Page Application (SPA) design pattern, Razor Pages (Page based more cleaner MVC model) design pattern and traditional MVC (View based model) design pattern. These design patterns are mostly used in hybrid manner, but, can be utilize as individual only pattern as well.
Today's demonstration is more theoretical than code base as I will try to elucidate ASP.NET Core 2 architecture and ideology behind some core design patterns being made part of the ASP.NET core 2 development templates.
ASP.NET Core Architecture
The ideology behind the ASP.NET core in general as the name suggests is to layer out web logic, infrastructure and core components from each other in order to provide more development friendly web development environment. The concept is somewhat similar to "N" tier/layer architecture, the only difference is that ASP.NET core defines the layers as core component of the platform which ease the developer from redefining it in order to make solution more modular and reusable. What happens in ASP.NET core is that main Business logic and UI logic are encapsulated in ASP.NET core Web App layer, while, database access layer, cache services and web API services are encapsulated in infrastructure layer and common utilities, objects, interfaces and reusable business services are encapsulated as micro-services in application core layer.So, in essences ASP.NET core creates necessary per-defined "N" tier/layers architecture for us developers automatically, which saves our time and effort to worry less about the complexity of necessary "N" tier/architecture of the web project and focus more on the business logic. In non-ASP.NET core environment, what happens in general that we as a developer are more focused on the business logic and the selection of best design patterns not on the architecture side because at the end of the day the final version of our web project is deployed on a single tier machine and we are more focused on managing the complexity of the project in terms of code re-usability and modular components but on a single tier, very few organizations/enterprises actually implement "N" tier/layer architecture to make their product more robust and modular as "N" tier/layer architecture requires more resources consumption, management for scaling the project as necessary and of course hiring of more skilled resources that can build the necessities.
No wonder you will find many modern web development frameworks more pre-build design pattern friendly rather that pre-build tier/layer friendly, for, that matter, a developer need to make the necessary tiers/layer himself/herself and no wonder MVC design pattern is the most popular for web development. Remember that design pattern and architecture are separate concepts, unfortunately, many senior developers refer design pattern and architecture as same, so, they refer MVC as architecture rather than design pattern. So, here comes ASP.NET core that brings the benefit of pre-build architectural framework that ease out tier deployment of the project along with providing pre-build Single Page Application (SPA) design pattern, Razor Pages (Page based more cleaner MVC model) design pattern and traditional MVC (View based model) design pattern. These design patterns are mostly used in hybrid manner, but, can be utilize as individual only pattern as well.
ASP.NET Web Core 2 Project Templates
So, here are the list of project templates that ASP.NET web core 2 provides i.e.- ASP.NET Core Web App (Razor Pages).
- ASP.NET Core Web App (Model-View-Controller).
- ASP.NET Core Web API (no UI).
- ASP.NET Core with Angular (SPA).
- ASP.NET Core with React.js (SPA).
- ASP.NET Core with React.js and Redux (SPA).
Traditional Web Application Vs Single Page Application (SPA)
There are two approaches in which a web application is being built i.e.
- Traditional Web Application.
- Single Page Application (SPA).
1) Traditional Web Application
In Traditional Web Application development style, UI application logic is performed at server side. For example, in MVC design pattern application every time user clicks, the web request is sent back to server and on response entire page is reloaded, even with ajax calls to load only necessary component, the logic against any action is done at server level and then necessary UI or component on screen will load. This development style makes frequent web request calls impacting performance of the website.2) Single Page Application (SPA)
In Single Page Application development style, UI logic is performed at client (web browser) side and server side is communicated primarily for data processing through web api calls. For example, modern front-end framework AngularJS provides all the necessary tools to perform interactive UI logic at client side and make only necessary calls to the server side. This definitely reduces frequent server requests and improves performance.When to choose Traditional Application vs Single Page Application (SPA) Development Style
Here below is the excerpt from Architecting Modern Web Applications with ASP.NET Core 2 and Microsoft Azure book that explains well about the decision for development approach. Notice that most of the time hybrid approach is being used for development style:
Factor
|
Traditional Web App
|
Single Page Application
|
Required Team Familiarity with
JavaScript/TypeScript
|
Minimal
|
Required
|
Support Browsers without Scripting
|
Supported
|
Not Supported
|
Minimal Client-Side Application
Behavior
|
Well-Suited
|
Overkill
|
Rich, Complex User Interface
Requirements
|
Limited
|
Well-Suited
|
Nice go through.
ReplyDeleteWhich is great but with the templates not being kept inline with new releases of the spa frameworks it still works out easier rolling the whole thing by hand from an empty project !
ReplyDeleteHey, this is an Amazing article. This article is a good read to know more tips on designing the web.
ReplyDeleteProWeb365
Such A Nice Post, Keep Up The Fantastic Work. Do check the link below:
ReplyDeletecustom logo
Great post! Thanks for sharing a piece of informative information. It would be helpful for newbies, keep posting. I appreciate your efforts. Click here.
ReplyDeleteThis is great job, thanks for sharing it with us.
ReplyDeleteBuy law essay
Excellent Blog! I would like to thank for the efforts you have made in writing this post. I am hoping the same best work from you in the future as well. I wanted to thank you for this websites! Thanks for sharing. Great websites! Modern Java EE Design Patterns PDF
ReplyDeleteI have read good things here. Definitely worth to bookmark again. I am amazed at how much effort you put into creating such an informative website.
ReplyDeleteData Science Training in Bangalore
I think this is an informative and very useful and knowledgeable blog. therefore, I would like to thank you for your effort.
ReplyDeleteData Science Course in Jaipur
it's really nice and meanful. it's really cool blog. Linking is very useful thing.you have really helped lots of people who visit blog and provide them usefull information. Web Design Oxford
ReplyDeleteAllow each coat to dry before applying the next, and then on the final coat, use the hand sander to lightly sand it.Meridian ID
ReplyDelete