- Structural elements
- Connective elements
Structural elementsStructural elements in software are layers that support other layers in the system:
- the language libraries are built on the functionality provided by the O/S
- the functionality of the software product is built on the language libraries
- 3rd part libraries that you are using are built on the previous 2 layers
- your code is built on all the previous layers
So any program you build has at least the following structural elements:
Connective elementsEvery software system has connective elements that communicate across the different layers. Often 3rd party libraries are shared services that provide core services like data structures (XML, JSON, etc), logging, debugging, and other services.
Inside your code you will also have shared services that are used by every layer, this is diagrammed as follows:
Generalizing ArchitectureWhen people are talking about software architecture, they are not just talking about the structure of the code. Often people are talking about the machines and O/S components as well. So for example when people are talking about the LAMP architecture they are talking about:
- The O/S -- i.e. Linux
- The web server -- Apache, running on Linux
- The database -- MySql, running on Linux,
- The code -- PHP running on the MySql database using services from the O/S
So when relevant, architecture includes:
- The O/S
- All support services, i.e. webserver, database, etc.
- The high level applications written by you or a 3rd party
General Software Architecture
- The model layer a.k.a. business layer is built on 3rd party APIs and O/S APIs
- The view layer a.k.a. GUI layer is built on 3rd party GUI APIs
- The data layer is build on database APIs
- Changing languages requires that every layer above it be reconsidered
- This means that if you change languages and some 3rd party API must be changed then the layer above also needs to be changed
- Strict separation in layers means that you can change a 3rd party API and only a single layer of the MVC system is affected
- Often developers color between the lines and a change of a 3rd party library causes quite a bit of pain as the layer infractions are found
- Not having enough of a business layer will be problematic because it is one of the main separating structures between your view/GUI and data layers.
- People discover lacking business layers when they change their database APIs or databases and have the problems propagate all the way through the GUI
- Often when business functionality is built into the model/GUI layer then that functionality is lost and needs to be recoded when a new GUI API is used
Other connective elements are most easily recognized because they are routines shared across layers of the architecture. More specifically, they are the libraries/modules that are included into multiple layers of the program.
So now we have defined what structural and connective elements are in software, next we describe what it means to have good architecture and bad architecture.