In this article, I will like to discuss about two perspectives of Software Architecture that I learnt from my works and books;
The two perspectives are:
- Macro Software Architecture: A high level view describing the overall system of the software service;
- Micro Software Architecture: A lower level view describing the internal structure of a software;
Macro Software Architecture
Why we need
When we build a software or a service, we usually consist of many functions to fulfil different requirements;
- Some of them are required by the end users. e.g A push notification will be received if my friend sent something;
- Some of them are required by the Marketing colleagues. e.g how many Daily active users;
- Some of them are for the availability. e.g Backup the data to another servers;
Therefore, it will be several different software systems or components to achieve different requirements; In order to help the team know clearly about how the software can built, it is a good idea to draw the macro architecture;
What should describe
The macro software architecture should tell the following information:
- What are the entities (Software systems, Users, …) involved?
- What are the systems we should build ?
- What are the systems are provided by other developers?
- How the entities connect to each others?
- Is it using http connection and in REST style?
- Is it using socket connection and with connection pool?
Triend – A social networking app built by my company:
In our app, it consists of several software parts:
- Two mobile client (android and iPhone);
- An application server
- A database
- File system storing the images sent by users
- Push Notification Web service (provided by Parse)
- Geocoding Web service (provided by Google)
- Several Backup scripts
And are connected in different ways:
- HTTP connection in REST style
- Socket connection with connection pool
- File I/O
Micro Software Architecture
Why we need
When we build a software system, we may encounter an issue that the requirements of the system is keep changing or adding; To deal with it, need design a micro software architecture that is change-friendly; Unlike the Macro Architecture, micro architecture focus how one system perform its functions which may be one of your product’s services; A good micro architecture also help us to resue code from one project to another;
What should describe
In order to make a good micro software architecture that can adapt change, you need think which part in the architecture are the core business logic and which part are common logic;
So the micro architecture should tell about:
- The base architecture: The common logic that help building the business logic;
- The components: The logic that serving the system requirements;
- How can components plug in the base architecture; This is also called “Interface”;
- The internal modules contained in the base architecture;
I would like to “a computer” as the metaphor of the micro software architecture; When opening a computer case, you will see different parts, the motherboard, cpu, memory, hard drive, etc, … ;
The motherboard is like the base architecture; There are lots of slots that fit different components; There are jumpers for configuration;
CPU, Memory, hard drive, etc are like components; They just do their own tasks, memory for storing data, CPU for calculation; They also need to have a proper interface to that let them plug into the motherboard;
Shooter – A cocos2d-x shooting game
In my game, the base architecture is the Cocos2d-x game engine; The engine help me on a lot of things such as render my object to the screen, user input handling, gui building blocks, scene transition;
And the components I built are:
- My game objects – My spaceship and enemy monsters;
- Game scenes – Title Screen, Game scenes, ..
When building a software, the knowledge of architecture is important for us no matter you are using it or making it; It can prevent us not eroding the software and can help us build new function in a more efficient way; Another note I like to mention is that Software architecture cannot be designed perfectly in the early stage, it should evolve or rebuild sometimes;
- Software Architecture and Design by Microsoft:
- Software Architecture mini-course in Udacity: