12 - Database Application Development

Table of Contents

Welcome to Week 12

For this week, we turn the page away from direct database work and look into the world of database application development and how the database fits into the world of software and software development. We will investigate the software development life cycle (SDLC) and then more specifically the database development life cycle (DBDLC) and their various steps.

This week the students will form groups and start to write a simple C++ program to complete a series of simple CRUD statements. The first and hardest part of this is getting the programming environment setup and establishing a connection.

Application Development and Design

Application TiersThe process of developing software applications, whether they are web based, windows software, mobile applications and other, are typically developed in multiple tiers.

These Tiers typically include:

  1. Presentation / User Interface / View Layer
  2. Business Logic / Application Logic / Controller Layer
  3. Resource Management / Data Access / Model Layer

Each layer is called different things in different perspectives or in different software frameworks. They are essentially synonymous.

Model Layer

The model layer is often design to include software that represents the structure of the database and the DML statements and routines needed to manipulate the data, both reading and writing. This can be accomplished through creating a series of classes that represent the database entities (example: tables) with properties, constructors, and methods that are representative of the database CRUD statements.

Business Logic Layer

The business logic layer is the middle layer that takes input from the user interface and translates it according to business rules and application rules to forward it to the database layer for storage or retrieval. Once the data layer completes it's tasks, the data is sent back to the middle layer, processed, calculations are performed and the results are sent to the user interface appropriately.

The business logic layer is kept separate from the data access and user interface layer such that changes can be made to the business rules with little or no impact on the other layers, due to the separation of concerns in the software development process.

View or User Layer

The User-Interface layer often is a web site, mobile application or a windows application. Access between the user interface according and the business layer can be controlled through user access and role management and if often accessed through an API (Application Programming Interface).

Roll of Databases in Modern Software Development

Almost every modern software application has a database involved in the background. The purpose of the database could be:

Therefore, it is important that all software developers have a basic database design and implementation knowledge. In larger companies, software developers rarely touch the database, but even in this case, they still need the knowledge to work as part of the team and to assist with the development of the data model layers of the software.

In smaller development companies, where employees are often involved in many areas of the Software Development Life Cycle (SDLC). including database development, software development and the entire design process. The second half of this course concentrates of the database design aspects of this process and how building a strong database foundation is key to developing strong software.

N-Tier Development and MVC

The reason why a significant amount of software development is completed using the n-tier architecture is such that various aspects of the application can be kept independent for object oriented purposes. Keeping the layer independent allows them to be reusable, and multi-purposed.

The model layer can be shared amongst many different user interfaces and can be reused for many different versions of the application. For example, access to the model layer can be through an API ro directly in the case of administration access systems.

In some cases, software is divided into addition tiers to further separate concerns. One example of this: is to create a security layer that controls and centralizes user access, administration, role management, and permissions to perform specific actions within the business and data tiers.

Design Methods

When designing software, software companies take different approaches to each application developed and the decision is based on the application being developed, the client involved and the project scope and timeline.

Some of the approaches to database driven applications include:

Bottom-Up or Database-First Approach

Top Down DesignThis approach involves developing the database first in the application development process. This means that a significant amount of research goes into the data requirements of the application through the requirements gathering process. Through database modelling processes and database normalization, designers can come up with near complete database designs.



Top-Down or UI-First Approach

Top Down Design This approach entails the design of the user interface first. The functionality of the system is defined from the client's perspective. Many clients are most interested in how the software works, how it looks and its' ease of use. Therefore, this part of the application can be perfected with the client first.



Inside-Out or Code-First Approach

This approach is similar to the bottom-up approach but focuses on the database access or model layer first built based upon the data requirements gathering process. This object orientated approach allows developer to create the required classes, properties and methods first and then generate the database from the code.

PROS: This approach works well for a team with strong developers, and can give the developers a deep understanding of all the code that will be accessed through the entire development process.

CONS: This approach often results in an incomplete database design and many criteria and database features missing, such is indexes, referential integrity and the use of stored procedures and user-defined functions.

Outside-In or Client Centric Approach

This approach uses the requirements gathering results and simultaneously designs both the database and user interface layers. Then as both ends are developed, they will work inwards towards the business logic layer.

PROS: This balances the client interactive parts of the development with those parts where very little client interaction is involved. This means the client sees continuous and consistent progress through the project and keeps lines of communication open.

CONS: This approach can often result in reiterating the design of both the user interface and data access layers because of considerations determined through the middle or business logic tiers.