ASP.NET WebForms vs MVC

ASP.NET Web Forms and MVC both have their pros and cons.  Below I have them outlined. ASP.NET Web Forms Web Forms is a visual approach for web development using a drag-n-drop,  event-driven model. Advantages Rapid Application Development (RAD) Feature-rich server controls Data binding Higher level of abstraction over a stateless web.  Simulates statefulness with support for ViewState. Smaller learning curve for WinForm developers Disadvantages Undefined Application Architecture with lack of Separation of Concerns (SoC) Limited control over HTML Complicated page life cycle with performance issues Hard to keep up with fast evolving web platforms without expensive 3rd party control updates or waiting on Microsoft updates Not a good technology for designers who like working with HTML directly Limited support for testing ASP.NET MVC MVC is a framework for building web applications using the Model-View-Controller architectural pattern.  This … [Read more...]

Onion Architecture

Although there is no single silver bullet for every solution, most developers get locked into an architecture that doesn't scale and changes becomes difficult and slow as the system grows. Onion Architecture promotes a separation of concerns and a decoupled application.  Loose coupling makes it easier to upgrade or replace components without affecting other parts of the system. This architecture is best suited for complex behavior and long-lived business applications. It may not be feasible for small websites. Traditional Layered Architecture Each layer depends on the layers beneath it and every layer will depend on some common infrastructure and utility services.    Problems with Traditional Architecture Application is built on top of specific technologies that are sure to change Business logic is commonly added to the UI layer Transitive dependencies: makes it easy to take a dependency without putting much thought into it, and now it’s all over the code … [Read more...]

Common Practices for Software Projects

  Three typical classifications for common kinds of software projects along with their best practices. Business Systems Common Application Types: Internet and intranet sites, payroll systems, games Life-cycle models: Agile development (XP - Extreme Programming, Scrum, time box development, etc) Evolutionary prototyping.  In Evolutionary prototyping, development evolves over time as we better understand the requirements and build only those parts of the system that are well understood. Planning, management and requirements: Incremental project planning Informal change control and requirements specification Design, construction and deployment: Design and coding are combined Informal or no check-in procedure Informal deployment procedure Testing and QA: Developers test their own code Little or no testing by a separate group   Mission-Critical Systems Common Application Types: Embedded and packaged software, internet sites, web … [Read more...]

What is circular dependency and why is it bad?

Circular dependency is when two pieces of code each depend on each other.  Circular dependency is usually considered a sign of bad design. We typically develop software by: Dividing our code into components (i.e piece of code by class, namespace, assemblies). Making sure that there are no dependency cycles between our components. Below is a standard 3-tier Layered Architecture.  As a rule, each layer should only depend on the ones beneath it. Circular dependency happens when higher layers depend on lower layers and lower layers depend on higher layers. Why circular dependencies should be avoided: It causes tight coupling between layers. Code with cross-dependencies will be harder to understand and maintain than with a clean, layered structure. They are difficult to unit test because they cannot be tested in isolation from one another. .Net projects cannot have circular references as it is impossible to build only one of them without the other.  Even … [Read more...]