Object-Oriented Data Model and Its Application

Abstract

Complex software requires adequate preparation on behalf of software engineers and designers. Before developing a software solution, many design documents need to be created to capture the requirements precisely and provide a reference repository for engineers. A data model is a design document that is used when developing a persistence module of the program. It is comprised of objects that will be used in the program and define their relationship and business logic. An entity-relationship diagram is a traditional approach to data modeling. With the advent of object-oriented programming, however, professionals have started using object-oriented techniques. A data modeling procedure that is based on object-oriented principles is called object-oriented data modeling. The most popular approach to this kind of modeling is using Unified Modeling Language Class Diagrams. This approach has many benefits over traditional entity-relationship modeling, including support for inheritance and multiple levels of interactions between objects.

Before a single line of code is written when developing enterprise applications, software architects, along with senior engineers, devise a design document based on client requirements. Among these artifacts is a data model that captures entities and their relationships to be stored in a database. Data modeling is conceptually representing all objects that will exist in the system, along with corresponding rules and the logic of how each entity interacts with other items. The resulting model establishes naming conventions to facilitate consistency, describes security mechanisms to protect data, establishes default values, and enforces rules to comply with government regulations, including the issues of privacy and the processing of personally identifiable data. From a programmer’s and database designer’s perspective, a data model is a blueprint for creating an implementation of the system. Data models can be represented as entity-relationship diagrams (ERD) or object-oriented models. This paper will discuss why object-oriented data modeling was proposed and what challenges it helps overcome.

Overview of Object-Oriented Modeling

Object-oriented programming (OOP) emerged as a response to the increasing complexity of software systems. The idea was that common functionality can be abstracted through programming constructs, leading to a significant code-reusability while maintaining the flexibility of adding specific features (Onu & Umeakuka, 2016). In terms of persistence, relational database management systems (RDBMS) have been dominant for many decades (Mancas, 2016). Relational databases are based on tables, while OOP relies on inheritance (Mancas, 2016). This sharp difference has provided a clean separation between persistence and software code. To design a relational database, one needs to create an ERD, which encompasses what entities exist in a system and how they relate to each other. Based on identified relationships, database programmers could create the necessary tables to store the data. From an OOP software engineer’s perspective, ERDs do not allow inheritance and code reuse (Mancas, 2016). Instead, each entity is designed separately and contains an exhaustive list of properties. If two entity types are similar and have common characteristics, it is impossible to reuse those attributes in an ERD. Therefore, the need for object-oriented data modeling and object database systems emerged.

Purpose

The goal of object-oriented data modeling is the creation of a diagram that can be used by both a software engineer and a database designer. This type of modeling uses the OOP concepts, such as the notion of class, inheritance, and encapsulation, heavily (Planas & Cabot, 2020). The first step is the same as when developing an ERD – identification of entities. Instead of listing all attributes for each entity and drawing how they relate to each other, in object-oriented modeling, the designer must first determine the entities with common characteristics. The next step is to abstract the common features of a base class and reuse them for subtypes. For instance, if a database should store employees and customers, common attributes, such as Name and Surname, can be stored in an abstract Person class. The purpose of object-oriented modeling is to make a diagram concise and to facilitate the reusability of components (Howroyd & Thring, 2018). This approach solves a similar problem OOP was set to solve – it successfully handles increased complexity and aids human understanding of a system.

Application

Despite the benefits of object-oriented modeling, object databases have not received widespread adoption. The database industry is currently dominated by relational database management systems, such as Microsoft SQL Server, and non-relational database systems, such as MongoDB and Cassandra (Gorman, 2020). Relational databases do not support inheritance natively, which may necessitate the development of ERDs. However, with modern tools, an object-oriented data model may be the only diagram used even if a relational system is utilized for persistence (Gorman, 2020). In most circumstances, databases are designed with a code-first approach that relies on the presence of an object-oriented data model.

A software architect first identifies required entities and the relationships while storing common attributes in base classes. One of the most popular diagrams to capture objects in an OOP style is a Unified Modeling Language (UML) Class Diagram (Planas & Cabot, 2020). Using this document, a software engineer creates necessary classes using an OOP language, such as C#, and employs an Object-Relational Mapper (ORM) to convert these objects to RDBMS tables (Gorman, 2020). An ORM system, such as Entity Framework Core that is used when working within a.NET environment, handles a two-way conversion – from object to table and from table to object (Gorman, 2020). The emergence of ORMs reduced the need for the development of dedicated object database management systems.

There is another approach called database-first that can be used when constructing databases. In this case, however, both an ERD and an object-oriented model may be needed. On the programmer’s side, a class diagram is used to create necessary classes while a database developer uses an ERD model to create tables (Gorman, 2020). An ORM is then configured to correctly map objects to tables that are already present in the system (Gorman, 2020). The popularity of the database-first approach has been declining because of its complexity (Gorman, 2020). Object-oriented data modeling is used in most cases with the code-first method.

Basic Constructs of a Class Diagram

A UML class diagram is constructed using boxes that define classes, their attributes, methods, and their relationship with other objects. Unlike ERD, class diagrams support multiple levels of interclass interaction – instance-level, class-level, and general relationship (Planas & Cabot, 2020). Instance-level interactions are visualized using special line notation and can show a simple association, aggregation, or composition (Planas & Cabot, 2020). Class-level relationships include inheritance to generalize classes and reuse their attributes, and implementation to show that a class supports a specific functionality. A general relationship is analogous to relationships between entities in an ERD. Each box in the diagram has three compartments – one for the class name, one for its members, and one for methods (Planas & Cabot, 2020). It is significant to note that each class has members indicated within their box, and also the members that a class they derive from has. For instance, a Person class may have Name and Surname fields, while an Employee class that derives from Person includes information that is specific to the Employee type. Besides specific attributes, the Employee inherits every member of the Person class.

References

Gorman, B. L. (2020). Practical entity framework. Apress.

Howroyd, S., & Thring, R. (2018). An electric vehicle model and validation using a Nissan Leaf: A Python-based object-oriented programming approach. Advances in Mechanical Engineering, 10(7), 1-7. 

Mancas, C. (2016). Conceptual data modeling and database design: A fully algorithmic approach. CRC Press.

Onu, F. U., & Umeakuka, C. V. (2016). Object oriented programming (OOP) approach to the development of student information management system. International Journal of Computer Applications Technology and Research, 5(8), 504-508.

Planas, E., & Cabot, J. (2020). How are UML class diagrams built in practice? A usability study of two UML tools: Magicdraw and Papyrus. Computer Standards & Interfaces, 67, 1-13. 

Cite this paper

Select style

Reference

StudyCorgi. (2022, June 14). Object-Oriented Data Model and Its Application. https://studycorgi.com/object-oriented-data-model-and-its-application/

Work Cited

"Object-Oriented Data Model and Its Application." StudyCorgi, 14 June 2022, studycorgi.com/object-oriented-data-model-and-its-application/.

* Hyperlink the URL after pasting it to your document

References

StudyCorgi. (2022) 'Object-Oriented Data Model and Its Application'. 14 June.

1. StudyCorgi. "Object-Oriented Data Model and Its Application." June 14, 2022. https://studycorgi.com/object-oriented-data-model-and-its-application/.


Bibliography


StudyCorgi. "Object-Oriented Data Model and Its Application." June 14, 2022. https://studycorgi.com/object-oriented-data-model-and-its-application/.

References

StudyCorgi. 2022. "Object-Oriented Data Model and Its Application." June 14, 2022. https://studycorgi.com/object-oriented-data-model-and-its-application/.

This paper, “Object-Oriented Data Model and Its Application”, was written and voluntary submitted to our free essay database by a straight-A student. Please ensure you properly reference the paper if you're using it to write your assignment.

Before publication, the StudyCorgi editorial team proofread and checked the paper to make sure it meets the highest standards in terms of grammar, punctuation, style, fact accuracy, copyright issues, and inclusive language. Last updated: .

If you are the author of this paper and no longer wish to have it published on StudyCorgi, request the removal. Please use the “Donate your paper” form to submit an essay.