Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
23 views

11-Database Programming Model

Uploaded by

Rehan Khan
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views

11-Database Programming Model

Uploaded by

Rehan Khan
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 25

Database Programming Model

Database Programming Model


• A database programming model provides a structured approach for
interacting with and manipulating data in a database.

• It defines the concepts, constructs, and operations used to access,


manage, and modify data.
Database Programming Model
• The primary goal of a database programming model is to simplify the
interaction between application programs and the underlying database
system.

• Data modeling is the process of creating a visual representation of


either a whole information system or parts of it to communicate
connections between data points and structures.
Database Programming Model
• Data models can generally be divided into three categories, which
vary according to their degree of abstraction.

• The process will start with a conceptual model, progress to a logical


model and conclude with a physical model.

• Each type of data model is discussed in more detail in subsequent


sections:
1- Conceptual data models
• They are also referred to as domain models and offer a big-picture
view of what the system will contain, how it will be organized, and
which business rules are involved.

• Conceptual models are usually created as part of the process of


gathering initial project requirements.
1- Conceptual data models
• Typically, they include entity classes (defining the types of things that
are important for the business to represent in the data model), their
characteristics and constraints, the relationships between them and
relevant security and data integrity requirements.

• Any notation is typically simple.


1- Conceptual data models
2- Logical data models
• They are less abstract and provide greater detail about the concepts
and relationships in the domain under consideration.

• One of several formal data modeling notation systems is followed.


These indicate data attributes, such as data types and their
corresponding lengths, and show the relationships among entities.
2- Logical data models
• Logical data models don’t specify any technical system requirements.
This stage is frequently omitted in agile or DevOps practices.

• Logical data models can be useful in highly procedural


implementation environments, or for projects that are data-oriented by
nature, such as data warehouse design or reporting system
development.
2- Logical data models
3- Physical data models
• They provide a schema for how the data will be physically stored
within a database. As such, they’re the least abstract of all.
3- Physical data models
• They offer a finalized design that can be implemented as a relational
database, including associative tables that illustrate the relationships
among entities as well as the primary keys and foreign keys that will
be used to maintain those relationships.

• Physical data models can include database management system


(DBMS)-specific properties, including performance tuning.
3- Physical data models
Data modeling tools
• Numerous commercial and open source computer-aided software
engineering (CASE) solutions are widely used today, including
multiple data modeling, diagramming and visualization tools.

• Here are several examples:


Data modeling tools
1. erwin Data Modeler is a data modeling tool based on the Integration
definition for information modeling (IDEF1X) data modeling
language that now supports other notation methodologies, including
a dimensional approach.
Data modeling tools
2. Enterprise Architect is a visual modeling and design tool that
supports the modeling of enterprise information systems and
architectures as well as software applications and databases. It’s
based on object-oriented languages and standards.
Data modeling tools
3. ER/Studio is database design software that’s compatible with several
of today’s most popular database management systems. It supports
both relational and dimensional data modeling.

4. Free data modeling tools include open source solutions such as Open
ModelSphere.
Database Connectivity
• Database connectivity refers to the mechanisms used to establish a
connection between an application program and the database system.

• JDBC (Java Database Connectivity) is a popular API for connecting


to relational databases in Java.
Object-Relational Mapping (ORM)
• ORM frameworks simplify the mapping between objects in an
application program and the underlying database tables.

• Object Relational Mapping (ORM) is a technique used in creating a


"bridge" between object-oriented programs and, in most
cases, relational databases.
Object-Relational Mapping (ORM)
• When interacting with a database using OOP languages, you'll have to
perform different operations like creating, reading, updating, and
deleting (CRUD) data from a database.

• While the ORM and ORM tools help simplify the interaction between
relational databases and different OOP languages.
Object-Relational Mapping (ORM) Tools
• An ORM tool is software designed to help OOP developers interact
with relational databases.

• So instead of creating your own ORM software from scratch, you can
make use of these tools.
Popular ORM Tools for Java

1. Hibernate: Hibernate enables developers to write data persistent


classes following OOP concepts like inheritance, polymorphism,
association, composition. Hibernate is highly performant and is also
scalable.
Popular ORM Tools for Java

2. Apache OpenJPA: Apache OpenJPA is also a Java persistence tool.


It can be used as a stand-alone POJO (plain old Java object)
persistence layer.

3. EclipseLink: EclipseLink is an open source Java persistence


solution for relational, XML, and database web services.
Advantages of Using ORM Tools

1. It speeds up development time for teams.

2. Decreases the cost of development.

3. Handles the logic required to interact with databases.

4. Improves security. ORM tools are built to eliminate the possibility of


SQL injection attacks.

5. You write less code when using ORM tools than with SQL.
Disadvantages of Using ORM Tools

1. Learning how to use ORM tools can be time consuming.

2. They are likely not going to perform better when very complex
queries are involved.

3. ORMs are generally slower than using SQL.

You might also like