Posts

Showing posts from July, 2016

Architectural style -> Adoptable system -> Reflection.

Image
Background - We have discussed very less about reflection, especially if you are C, C++, mainframe, LSI developer and working on server side implementation or in low level hardware-interaction development team.  But it is very popular among high level languages like JAVA, Scala, C#, Python etc, many languages have implemented reflection in it.  It gives you flexibility to do things dynamically (at run-time). After working closely with different clients, you will get a clear understanding that no one is as confusing as a software client, not even your girlfriend! So we should have a flexible architecture in place who can absorb shocks of client’s last moment changes. Not only that, sometimes we have N number of different behaviors and structure in place, and we want our application to behave differently depending upon run-time situations. Let’s build understanding step by step through an example. Think you have got an assignment where you have to build an application

Architectural pattern - Naked object.

Image
Background – This model is very close to MVC (model-view-controller) architectural pattern. I would recommend you to read MVC first if you have no idea about it. MVC is very nice for any complex application, but when you are dealing with a real time system where user is interested to monitor some specific objects, then implementing it through necked object will be easy. Please look at below mentioned diagram. (This diagram of MVC is taken from free internet sources) (This diagram of naked object is taken from free internet source)                    I am sure that above mentioned diagrams would have given you a good insight of what naked object is and how it is different from MVC , but let us talk some example so that it gets clear. Example 1 , think about an ATC ( air traffic controller ) who manage air traffic of airport, through switching on and off the lights on runway, so that flight shall land and reach to its destination safely. Without giving proper

Architectural pattern - data transfer object.

Image
Background – There are many angles you can look into performance issue. Many times we get complains that, your app is slow. One of the major area to look into performance improvement is inter process communication, sending data between two processes in client-server architecture is a costly operation, because many calls are synchronous (where client wait server to give processed data back) and even if it is asynchronous,   time taken to transfer data matters. One way to solve this problem is to reduce the number of calls between two processes, and pass more data whenever we are calling inter process methods, but for that we shall have well-defined interface with long list of method parameters. This approach is not very good because first , we have to very careful with the sequence of parameter while calling it (If we have 7 ints in function parameter list, as all take same type of parameter if you miss the sequence, it could lead to wrong result) second , doesn’t matter how mu

Active record.

Image
Problem statement – It is rare to imagine any software application without records. Records are the most important part of any large software application, we apply business logic on those records and keep them safe and clean. There are many robust and nice tools to save records - oracle DB, MySql, MS SQL Server, etc. For example I am mentioning a student table below. Databases are the key layer of any application, but user deal with an interface (or GUI - graphical user interface) developed in some programming language (i.e HTML5, C++, JAVA, C# .NET , etc.) not with database directly, we save our records in database.  It means you need something which connect to database from your business layer, we have to figure out what? Answer is ORM. What is ORM? Some legacy application (which don’t follow all OOPs principles) use DB as just a storage and perform DB operations according to business requirement (from some part of their code base, without applying