Object Oriented Architecture
Without a good architecture, software systems can be hard to understand, predict, manage, and optimize. When developers do not maintain a good architecture, they increase the risk of the project’s failure, or decrease the maintainability of a large scale application. This results in higher long term maintenance costs.
The idea behind object-oriented programming is that a computer program may be seen as a collection of individual objects, as opposed to a traditional view in which a program may be seen as a collection of functions. Each object is capable of receiving messages, processing data, and sending messages to other objects. Each object can be viewed as an independent entity with a distinct role or responsibility.
Object-oriented programming (OOP) will promote greater flexibility and maintainability in development, and is widely popular in large-scale software engineering. OOP is generally easier to learn for those new to computer programming than previous approaches. Since the OOP approach is often simpler to develop and to maintain, it lends itself to more direct analysis, coding, and understanding of complex situations and procedures than other programming methods. This in turn, leads to a decrease in the learning curve associated with introducing a new team member to the application.
In OOP, it is common to separate the application into different layers of functionality. Each layer has a specific focus and subset of tasks that it will accomplish. Generally, each layer will be partially dependent on the previous layers, however, the layers are designed in such a way that any one layer could be taken out and replaced with another layer, as long as both the inputs and outputs of the new layer are the same as the old layer. The object model that J Wautier Consulting would implement would consist of the following layers:
- Presentation Layer
- Framework/Shared Services Layer
- Business Layer
- Integration Layer
- Data Access Layer
In the following sections, each of the layers listed above will be briefly described; both their purposes and relations to the system will be outlined.
Presentation Layer
The presentation layer will handle the physical display of data to the end user. This layer will receive its data from the business layer in an already “formatted” form. This layer will also be responsible for the collection and basic validation of user input.
Framework / Shared Services Layer
The framework/shared services layer will be a set of common business related tasks that have been somewhat standardized by other vendors. J Wautier Consulting will leverage these existing functions to minimize development time on industry standard items.
Some of the items that would be included in this layer are:
- Site structure and navigation
- Membership Services
- Configuration
- Logging
Business Layer
The business layer is where the majority of the business logic will be implemented. The business layer will act as a repository for data or objects that the other layers need to access. The business layer will be comprised of objects and collections. Each object will have methods and properties available to the other layers to accomplish business tasks. All data transformation, business validation, and other processing of data will generally be contained within the objects of the business layer.
A simple example of how the business layer functions would be a person object. In the real world, a person is a complex “thing”. People have many different properties that could be combined together to describe them. In the business world, some of these properties are things such as full name, mailing address, gender, etc. When saving a person’s data in a database, individual pieces of data are stored in many different columns. Many times, several of these columns will need to be joined or analyzed to obtain a practical piece of data that will describe the user. In this example, a person’s full name will be used.
The other layers will need to know a person’s full name. However, depending on the person, it could be any one of a number of combinations of first name, last name, middle name, prefix, and suffix. The person “object” would simply have a property called Person.FullName. However, the business logic in object would execute a subset of code that would analyze each of the pieces of data and return back a properly formatted full name according to the business rules it was programmed with. If at any time those business rules change, the developer only needs to change it in one spot in the business layer. Using non-object oriented methods, the developer may have had to make the same changes in X number of pieces of code, depending on how many times it was used in the application. As can be seen, the end result is that changes in business rules will not require large amounts of developer time and money to implement.
To enforce maintainable and effective OOP code, J Wautier Consulting suggests that all data that is displayed in the presentation layer, comes from objects created in the business layer. The business layer will load its objects with data from the database. All data will be loaded using standardized stored procedures and will be loaded automatically by the data access layer.
Data Access Layer
The data access layer will facilitate all direct writes and reads to and from the database. By separating the physical reading and writing into a separate layer, it reduces code and development time needed to create the business layer, as well as insures future upgrades and scalability of the database.
|