SPL – PS13 Persistence Layer.

Slides:



Advertisements
Similar presentations
Introduction to the Spring Framework
Advertisements

IMPLEMENTATION OF INFORMATION RETRIEVAL SYSTEMS VIA RDBMS.
With Microsoft ® Access 2010© 2011 Pearson Education, Inc. Publishing as Prentice Hall1 Identify Good Database Design A database is an organized collection.
1Key – Report Creation with DB2. DB2 Databases Create Domain for DB2 Test Demo.
Geodatabase basic. The geodatabase The geodatabase is a collection of geographic datasets of various types used in ArcGIS and managed in either a file.
Object Relational Mapping. What does ORM do? Maps Object Model to Relational Model. Resolve impedance mismatch. Resolve mapping of scalar and non-scalar.
Designing a Database Unleashing the Power of Relational Database Design.
Attribute databases. GIS Definition Diagram Output Query Results.
Microsoft Access 2007 Microsoft Access 2007 Introduction to Database Programs.
SEMESTER 1, 2013/2014 DB2 APPLICATION DEVELOPMENT OVERVIEW.
Data Access Patterns. Motivation Most software systems require persistent data (i.e. data that persists between program executions). In general, distributing.
CSE446 S OFTWARE Q UALITY M ANAGEMENT Spring 2014 Yazılım ve Uyguluma Geliştirme Yöneticisi Orhan Başar Evren.
Chapter 4: Organizing and Manipulating the Data in Databases
Entity Framework Code First End to End
Attribute Data in GIS Data in GIS are stored as features AND tabular info Tabular information can be associated with features OR Tabular data may NOT be.
By: Blake Peters.  OODB- Object Oriented Database  An OODB is a database management system in which information is represented in the form of objects.
Scalable Architecture for the Cloud. What????  Command Query Responsibility Segregation  What is it?  What kinds of apps is it for?  What are the.
 A databases is a collection of data organized to make it easy to search and easy to retrieve in a useful, usable form.
2005 SPRING CSMUIntroduction to Information Management1 Organizing Data John Sum Institute of Technology Management National Chung Hsing University.
Chapter 4: Organizing and Manipulating the Data in Databases
Introduction to Microsoft Access Overview 1. Introduction What is Access? A relational database management system What is a Relational Database? Organized.
File Processing Concepts – Field – combination of 1 or more characters that is the smallest unit of data to be accessed – Record – group of related fields.
Object Persistence (Data Base) Design Chapter 13.
Object Persistence Design Chapter 13. Key Definitions Object persistence involves the selection of a storage format and optimization for performance.
Hibernate Persistence. What is Persistence Persist data to database or other storage.  In OO world, persistence means persist object to external storage.
1 Mapping to Relational Databases Presented by Ramona Su.
Domain and Persistence Patterns. Fundamental Pattern Types Design Patterns Business Logic Patterns.
An Object-Oriented Approach to Programming Logic and Design Chapter 3 Using Methods and Parameters.
Database Systems Design, Implementation, and Management Coronel | Morris 11e ©2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or.
26 Mar 04 1 Application Software Practical 5/6 MS Access.
Burapha University, 2003 Object-Oriented Analysis Basic of Object Mapping to Relational Database.
Enterprise Integration Patterns CS3300 Fall 2015.
A U.S. Department of Energy Office of Science Laboratory Operated by The University of Chicago Argonne National Laboratory Office of Science U.S. Department.
JPA / HIBERNATE CSCI 6370 Nilayan Bhattacharya Sanket Sable.
XML and Database.
Introduction to Access Chapter 13 pages 1-4. What is a database??? Related information is stored in databases  All SC student information is stored in.
Topic : Hibernate 1 Kaster Nurmukan. An ORM tool The problem fixed by ORM Advantage Hibernate Hibernate Basic –Hibernate sessionFactory –Hibernate Session.
1 MS Access. 2 Database – collection of related data Relational Database Management System (RDBMS) – software that uses related data stored in different.
SqlExam1Review.ppt EXAM - 1. SQL stands for -- Structured Query Language Putting a manual database on a computer ensures? Data is more current Data is.
The Data Access Object Pattern (Structural – Not a GoF Pattern) ©SoftMoore ConsultingSlide 1.
Chapter 6 - More About Problem Domain Classes1 Chapter 6 More About Problem Domain Classes.
Coding and Formatting Data for Network Use Syntax – Format (2-bytes for port number) Semantics – Meaning of Allowed Content (binary 16-bit number, Port.
Topic : Hibernate 1 Kaster Nurmukan. An ORM tool Used in data layer of applications Implements JPA.
Oracle Business Intelligence Foundation - Commonly Used Features in Repository.
Introduction to ORM Hibernate Hibernate vs JDBC. May 12, 2011 INTRODUCTION TO ORM ORM is a programming technique for converting data between relational.
Introduction to File Processing with PHP. Review of Course Outcomes 1. Implement file reading and writing programs using PHP. 2. Identify file access.
CS 440 Database Management Systems Stored procedures & OR mapping 1.
 What is DB Testing ?  Testing at the Data Access Layer  Need for Testing DB Objects  Common Problems that affect the Application  Should Testers.
Hibernate Java Persistence API. What is Persistence Persistence: The continued or prolonged existence of something. Most Applications Achieve Persistence.
Database (Microsoft Access). Database A database is an organized collection of related data about a specific topic or purpose. Examples of databases include:
Don't Know Jack About Object-Relational Mapping?
Module 11: File Structure
MVC Architecture, Symfony Framework for PHP Web Apps
Practical Session 13 Persistence Layer.
Overview of Data Access
SQL – Application Persistence Design Patterns
Overview of Hadoop MapReduce MapReduce is a soft work framework for easily writing applications which process vast amounts of.
Un</br>able’s MySecretSecrets
Overview of Data Access
CS 2308 Exam I Review.
Databases & Consistency
SQL Application Persistence Design Patterns
Chapter 10 ADO.
Adding Multiple Logical Table Sources
Chapter 8 Advanced SQL.
The ultimate in data organization
List Based Objects.
SQL – Application Persistence Design Patterns
Generics, Lambdas and Reflection
Threads and concurrency / Safety
Presentation transcript:

SPL – PS13 Persistence Layer

Overview What is the persistence layer DTO’s and DAO’s Repository ORM

Persistence Layer Assume we have an application that is accessing a DB. If the application access the DB directly, every change in the DB structure, table format or application needs will require changes in several part in the code. Persistence Layer is a design pattern for managing the storing and accessing of permanent data. It manages the communication between the application and the DB and creates a separation between the application logic and the DB access.

Persistence Layer (cont) In order to demonstrate an implementation of the persistence layer, we will review the implementation of an assignment tester. The assignments tester uses a DB with the following tables: students – which includes the id of the student and it’s name. assignments – which includes the number of the assignment, and a string representing the expected output of the assignment. grades – which includes the grade of each student on a specific assignment.

DTO’s and DAO’s The implementation of the persistence layer revolves around 3 types of objects: DTO – Data Transfer Object DAO – Data Access Object Repository

DTO A DTO is an object that represents a record from a single table. It’s variables represents the columns of the table. DTO’s are passed to and from the persistence layer. When passed from the persistence layer to the application logic, they contain data retrieved from the database. When passed from the application logic to the persistence layer, they contain the data that should be written to the database.

DAO These objects contain methods for retrieving and storing DTO’s. In most cases, each DAO is responsible for a single DTO.

Repository In many cases, DTO’s and DAO’s are not sufficient. Since each DAO only knows how to handle a specific DTO, where should we put methods that aren’t related to just a single table? For example: create_tables method Queries that span multiple tables, using join Which DAO should hold these methods? The answer is the repository.

ORM The ORM is a method for mapping between a certain DTO object and it’s related table in a manner that suits any DTO. We use several assumptions for the ORM to work properly: Each DTO class represents a single table. The different DTO classes are obeying the same naming conventions – a class named Foo represents a table named foos. The DTO constructor parameters are the DTO field names and are the columns of the table represented by the DTO.