Ehsan Ghanbari

Experience, DotNet, Solutions

The meaning of Page Routing in nutshell

One of the most capabilities of modern web-based applications is the ability to swap content of the page without any page reload, Post-back and Request-Response. All of the operations are done by calling from UI and request from server and then changing the existing content of page with the newly retrieved contents.

That's what they call SPA (Single Page Applications),  working with these kinds of User interface is so easier as waiting for post back and refreshing  and replacing the pages sometimes are tedious. Rather than that in single page application most of the business rules are handles in UI and server side analyses are less in comparison to traditional web applications, so it tends to be more faster.   

Application lifecycle management(ALM)

Application lifecycle management is a set of pre-defined process and tools that include definition, design, development, testing, deployment and management to integrate, coordinate and manage the different phases of the software delivery process. It's not just writing code or a methodology to write better code and similar. It's just a continuous process of managing the life of a software application from concept to delivery throughout the entire development process.

By applying to ALM it's easy to coordinate the people, process and information in an iterative cycle of activities throughout the software-delivery supply chain. it help agile teams on making them to make better decision, manage costs and help them about the technical concerns. Throughout the ALM process, each of the software development processes could be easily monitored and controlled.

This first step in ALM is business case development analysis, it happens before the development process begins. Once the business case is approved, application development starts, and governance is now implemented through project portfolio management. The principal role of Application Lifecycle Management is to manage the life of a software application from concept to delivery throughout the entire development process. It provides visibility into product release readiness, automates development processes.

You can read more about ALM here as I did to learn and write this post:

Software development and butterfly effect

If you have developed a large scale system, you have seen that small mistaken changes at one place specially at the earlier steps has damaged the other parts in the future of the system. I'm not going to talk about a solution for it, Actually there is no any way to stop doing this changes and their affects. But you can reduce the amount of these unwilling issues by some technique.

These little changes at the first steps or maybe at a specific parts of software development ,is called butterfly effect which is discussed in chaos theory. Based on chaos theory small change anywhere in the system (requirement, analysis, design, code, testing) can cause a similar change nearby and that will another similar change. Maybe you have heard  that: "Small variation in the initial condition of a dynamic system may produce large variation in the long term behavior of the system", so it's worth to sit and analyze, design completely and then get start coding to reduce the butterfly effect in the future of your system.

This phenomena of sensitive dependence on initial conditions is known in physics as the butterfly effect. Errors in early collaboration, requirements, and design are tenfold as expensive to fix in the coding stage and it will be more expensive in the future. In general early analysis  about requirements at first (agile manifesto!), exact estimation of the project's scope, managing the development team(conventions and collaborations) are all the necessary to reduce the risky changes of a project.


Convention over configuration

Developers only need to specify unconventional aspects of the application and worry only about the unconventional parts of the application and architecture. Convention over configuration is a software design principle, philosophy and technique implied from the structure of the code instead of requiring explicit code. letting the code "just figure it out" from using naming conventions instead of explicit code or finding ways to avoid duplicating information in the system. Developers don't need to use a particular methodology or approach while that approach of methodology is true. During the development process, lots of events could be occurred, so you should follow some conventions and know them. But be careful that Too much convention can make code confusing and make system difficult to understand.

Optimistic and pessimistic concurrency control

Optimistic and pessimistic concurrency control AKA optimistic and pessimistic locking is a mechanism to preserve database integrity in multi-user applications. Optimistic and pessimistic are two kinds of locking control. In general concurrency control ensures that correct results for operations are generated. Perhaps you are familiar with locking to serialize the data for accessing shared data; for example when several people in a system are working on a same data, what will happen if they save the changes at the same time?? Imagine this condition about hundreds or thousands of users! I heard about Optimistic and pessimistic locking in "Patterns of Enterprise application" book by martin fowler, let's consider them separately.


Optimistic Concurrency: it is based on the conflict and transaction restart. Optimistic concurrency looks a little bit optimist when two operation occur simultaneously. for example when two user updating the same data, updates will be discarded and user will be informed later and system assumes that there will be no conflict but it will be checked again to save the future changes on the target data. Optimistic allows transactions to execute without locking any resources and it will just checked later and  If a conflict will be occurred, the application must read the data and attempt the changes again.


Pessimistic Concurrency: it uses locking as the basic serialization mechanism. it is called "Pessimistic" because you can imagine it in the worst condition. When two or more people are making changes in the same data, the lock will be placed and prevents the possibility of conflicting. Pessimistic concurrency control locks resources as they are required, for the duration of a transaction. In pessimistic approach system assumes that some people will try to make change in a same data at the same time, so system will not let all of them to make change at the same time, it will be done one request after another and no other thread or user can access the item while it is locked.



More information

  1. Patterns of enterprise application by martin fowler

About Me

Ehsan Ghanbari

Hi! my name is Ehsan. I'm a developer, passionate technologist, and fan of clean code. I'm interested in enterprise and large-scale applications architecture and design patterns. I spend a lot of time on software architecture. Since 2008, I've been as a developer for different companies and organizations and I've been focusing on Microsoft ecosystem all the time. During the past years, Read More

Post Tags
Pending Blog Posts
using Elmah in MVC4
Using FluentSecurity in MVC
Strategic design
Factory Pattern
time out pattern in ajax
Redis as a cache server
How to use PagedList In MVC
Multiple submit buttons in MVC
Domain driven design VS model driven architecture
What's the DDD-lite?