Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ideal .NET Architecture? [closed]

Tags:

architecture

I'm writing this question from the standpoint of an ASP.NET application. However I realize it may be suited to other contexts as well.

There are so many approaches to developing the common elements of an ASP.NET website. Here are a few I have come across:

  • LLBLGen
  • SubSonic
  • LINQ to SQL
  • Entity Framework
  • CodeSmith + .netTiers
  • NHibernate
  • Hand coding DAL/BLL/Presentation

I don't consider myself an expert developer by any means, however I do understand common OOP techniques well, and can get through all my projects just fine. I do however struggle with knowing how to 'architect' a site. By that, I mean, should I use n-tier architecture? Is that still the gold standard and the above tools just utilize that concept? I'm pretty sure I want to hold off on MVC until a future (or final) release.

*****Edit: I have removed the portion of the question which deals with patterns (singleton, factory) after having more fully understood the separation of the question. Thank you for all who have answered this part so far, however, my main focus is on the architecture portion.*****

Edit #2: I changed the title to be more of an agnostic question upon realizing this would apply to more than web-specific architecture.


Question: What steps do I take as a first step, when I have sat down in front of a blank canvas (solution file) with all my pre-written documentation and system requirements in hand ? Where do I go from there?

like image 760
Kyle B. Avatar asked Dec 23 '08 16:12

Kyle B.


People also ask

What is the architecture of the NET Framework?

The .NET Framework is a key component of the Microsoft .NET ecosystem and is available for free under an open source license. The architecture of the .Net framework focuses on two main things: The first of these is that the framework code is largely independent of the language in which it is written.

What is ASP NET Core architecture?

ASP.NET Core 3.1 is a cross-platform web framework that can be deployed to Windows, macOS, Linux or even to Containers. It’s the perfect framework to develop the Web APIs that drive the hottest web and mobile apps. The key to leveraging the benefits that ASP.NET Core brings to developers is having the right architecture to go along with it.

Do we need a basic logical architecture for an application?

Although the application architecture may vary depending upon the type of application we built, I strongly believe that a basic logical architecture must always be put into place even before we start to think in technical terms.

What are the advantages of using the NET Framework?

The .Net framework has been designed in such a way that it provides a high level of security. It is important to note that this framework has been optimized in such a way that it runs quickly. In addition to this, it allows the user to handle a large number of data types. It is also important to note that the .Net framework helps in reducing costs.


1 Answers

I think each of the methods you have outlined has its merits and its downsides. Which you choose will be a matter of personal preference, the experiences of those in your team and the type of project - Linq2Sql is great to get up and running quickly but might not be best suited to a large and/or complex enterprise project for example.. the best thing you can do there is try a few and get to know them.

As for patterns, they help solve specific and recurring problems in a proven way. They also aid familiarisation for developers who didn't write the code. As above, it is worth trying a few to get a feel for what they do and when to use them - but they solutions to specific programming problems rather than architectural patterns.

My typical working process runs:

  • Create a logical entity model
  • Create the data storage for the entity model
  • Create the data access code and business objects
  • Create the logic / business layer
  • Create the presentation layer

I would typically split Data Access and Business Objects, Business Logic and Presentation (web site / winforms) into their own projects, plus anything that I might want to re-use at a later date also goes in its own project. I also have a Base project containing common extensions and interfaces that I re-use in almost everything I do.

In terms of architecture, I try to ensure my projects are loosely coupled so that you can easily move from a three tier to n-tier architecture easily. Loose coupling also means that you can switch your backing store and all you need to do is write a new Data Access layer with all of your logic and presentation code remaining unchanged.

I think it's important not to get too hung up on three versus n tier - if you separate your concerns properly extending your system across multiple tiers at later date will not be a difficult exercise.

like image 151
flesh Avatar answered Sep 21 '22 23:09

flesh