آرمان حسين‌زاده آذر 89 1.  Access to data varies depending on the source of the data.  Access to persistent storage, such as to a database, varies greatly.

Slides:



Advertisements
Similar presentations
MicroKernel Pattern Presented by Sahibzada Sami ud din Kashif Khurshid.
Advertisements

Uncoupling Java Applications O’Reilly Conference on Java Brett McLaughlin.
Spring, Hibernate and Web Services 13 th September 2014.
Data Access Patterns Some of the problems with data access from OO programs: 1.Data source and OO program use different data modelling concepts 2.Decoupling.
SWE 4743 Strategy Patterns Richard Gesick. CSE Strategy Pattern the strategy pattern (also known as the policy pattern) is a software design.
Object-Oriented Enterprise Application Development J2EE Blueprints.
© 2005, Cornell University. Rapid Application Development using the Kuali Architecture (Struts, Spring and OJB) A Case Study Bryan Hutchinson
GoF Sections 2.7 – 2.9 More Fun with Lexi. Lexi Document Editor Lexi tasks discussed:  Document structure  Formatting  Embellishing the user interface.
ECE 355 Design Patterns Tutorial Part 2 (based on slides by Ali Razavi) Presented by Igor Ivković
Chapter 22 Object-Oriented Design
Web Application Architecture: multi-tier (2-tier, 3-tier) & mvc
Data Access Patterns. Motivation Most software systems require persistent data (i.e. data that persists between program executions). In general, distributing.
Creational Patterns Making Objects The Smart Way Brent Ramerth Abstract Factory, Builder.
Dependency Injection and Model-View-Controller. Overview Inversion of Control Model-View-Controller.
JDBC Session 5 Tonight: Data Access Patterns 1.J2EE Architecture & Design Patterns 2.The Data Access Tier 3.Data Access Patterns –DataAccessObject (DAO)
Design Patterns.
M i SMob i S Mob i Store - Mobile i nternet File Storage Platform Chetna Kaur.
COMP 410 & Sky.NET May 2 nd, What is COMP 410? Forming an independent company The customer The planning Learning teamwork.
05 - Patterns Intro.CSC4071 Design Patterns Designing good and reusable OO software is hard. –Mix of specific + general –Impossible to get it right the.
CHAPTER 14 USING RELATIONAL DATABASES TO PROVIDE OBJECT PERSISTENCE (ONLINE) © 2013 Pearson Education, Inc. Publishing as Prentice Hall 1 Modern Database.
Case Studies on Design Patterns Design Refinements Examples.
Architecture styles Pipes and filters Object-oriented design Implicit invocation Layering Repositories.
Design Patterns Elements of Reusable Object-Oriented Software
 Three-Schema Architecture Three-Schema Architecture  Internal Level Internal Level  Conceptual Level Conceptual Level  External Level External Level.
Andrew S. Budarevsky Adaptive Application Data Management Overview.
JBoss at Work Databases and JBoss Chapter 4 Jeff Schmitt October 26, 2006.
Core Indigo Patterns Ted Neward
Refactoring for Testability (or how I learned to stop worrying and love failing tests) Presented by Aaron Evans.
Unit 4 Object-Oriented Design Patterns NameStudent Number CAI XIANGHT082182A KYAW THU LINHT082238Y LI PENGFEIHT082220L NAUNG NAUNG LATTHT082195L PLATHOTTAM.
Abstraction CMPS Abstraction Abstraction mechanisms are techniques to deal with creating, understanding and managing complex systems Abstraction.
Design Patterns CSIS 3701: Advanced Object Oriented Programming.
Distribution and components. 2 What is the problem? Enterprise computing is Large scale & complex: It supports large scale and complex organisations Spanning.
Design Patterns -- Omkar. Introduction  When do we use design patterns  Uses of design patterns  Classification of design patterns  Creational design.
Netprog: Corba Object Services1 CORBA 2.0 Object Services Ref: The Essential Distributed Objects Survival Guide: Orfali, Harky & Edwards.
Metadata Store Management Platform GE:architectural notes Fabrizio Verroca, Roberto Pagnin Telecom Italia WP1.3, FIWARE
Behavioral Patterns CSE301 University of Sunderland Harry R Erwin, PhD.
COMP9321 Web Application Engineering Semester 2, 2015 Dr. Amin Beheshti Service Oriented Computing Group, CSE, UNSW Australia Week 8 1COMP9321, 15s2, Week.
Java EE Patterns Dan Bugariu.  What is Java EE ?  What is a Pattern ?
Representational State Transfer (REST). What is REST? Network Architectural style Overview: –Resources are defined and addressed –Transmits domain-specific.
Persistent State Service 1  Concept  Persistence is the ability of an object state to survive termination of the process in which the object executes.
The Data Access Object Pattern (Structural – Not a GoF Pattern) ©SoftMoore ConsultingSlide 1.
Pattern Bridge. Definition Bridge is the structural pattern that separates abstraction from the implementation so that both of them can be changed independently.
REST By: Vishwanath Vineet.
Copyright 2007 SpringSource. Copying, publishing or distributing without express written permission is prohibited. Introduction to Data Access with Spring.
Advanced Object-oriented Design Patterns Creational Design Patterns.
The Facade Pattern (Structural) ©SoftMoore ConsultingSlide 1.
Basics of JDBC Session 14.
CS 5150 Software Engineering Lecture 16 Program Design 3.
Spring JDBC Dima Ionut Daniel. Contents What is Spring JDBC? Overview Spring JDBC Core SQL Exceptions Database Connection Batch Operations Handling BLOB/CLOB.
Copyright 2007, Information Builders. Slide 1 iWay Web Services and WebFOCUS Consumption Michael Florkowski Information Builders.
Question 1 Which of the following requires object database technology? A. Storing employee picture on disk B. Retrieving an employee picture C. Retrieving.
Technician Table Editor Academic advisor : Professor Ehud Gudes Technical advisor : Menny Even Danan Team: Olga Peled Doron Avinoam Ira Zaitsev ADD Presentation.
ORM Basics Repository Pattern, Models, Entity Manager Ivan Yonkov Technical Trainer Software University
CLASSIFICATION OF DESIGN PATTERNS Hladchuk Maksym.
Data Access Patterns Problems with data access from OO programs: 1.The object-relational impedance mismatch 2.Decoupling domain logic from database technology.
Presented by FACADE PATTERN
COMP9321 Web Application Engineering Semester 1, 2017
ATS Application Programming: Java Programming
Congo Exports Group Presentation Nick Bakunowicz Gabe Gottfredsen
Design Patterns Lecture part 2.
SOA (Service Oriented Architecture)
Distribution and components
Facade Pattern Jim Fawcett CSE776 – Design Patterns Summer 2010
Presented by Igor Ivković
Inventory of Distributed Computing Concepts and Web services
Informatics 122 Software Design II
Lecture 1: Multi-tier Architecture Overview
ARCH-1: Application Architecture made Simple
Informatics 122 Software Design II
Presented by Igor Ivković
Presentation transcript:

آرمان حسين‌زاده آذر 89 1

 Access to data varies depending on the source of the data.  Access to persistent storage, such as to a database, varies greatly depending on the type of storage (relational databases, object- oriented databases, flat files, and so forth) and the vendor implementation. 2

 persistent storage with different mechanisms  different APIs to access these different persistent storage mechanisms  explicitly access the persistent storage  direct dependency between application code and data access code  tight coupling between the components and the data source implementation  difficult and tedious to migrate the application from one type of data source to another 3

 Components need to retrieve and store information from persistent stores and other data sources  Persistent storage APIs vary depending on the product vendor  There is a lack of uniform APIs to address the requirements to access such disparate systems 4

 Portability of the components is directly affected when specific access mechanisms and APIs are included in the components  Components need to be transparent to the actual persistent store or data source implementation  easy migration to different vendor products, different storage types, and different data source types 5

 Use a Data Access Object (DAO) to abstract and encapsulate all access to the data source. The DAO manages the connection with the data source to obtain and store data.  Intent  abstracts the retrieval of data from a data resource such as a database. The concept is to "separate a data resource's client interface from its data access mechanism 6

 DAO implements the access mechanism required to work with the data source  data source  persistent store like an RDBMS  external service like a B2B exchange  repository like an LDAP database  business service accessed via CORBA  DAO completely hides the data source implementation details from its clients 7

 interface exposed by the DAO to clients does not change when the underlying data source implementation changes  allows the DAO to adapt to different storage schemes without affecting its clients or business components  Essentially, the DAO acts as an adapter between the component and the data source 8

9

10

 BusinessObject (Client)  object that requires access to the data source to obtain and store data  DataAccessObject  primary object of this pattern  abstracts the underlying data access implementation for the BusinessObject  enable transparent access to the data source  BusinessObject also delegates data load and store operations to the DataAccessObject 11

 DataSource  represents a data source implementation  could be a database such as an RDBMS, OODBMS, XML repository, flat file system, and so forth  TransferObject  Transfer Object used as a data carrier  DataAccessObject may use a Transfer Object to return data to the client  DataAccessObject may also receive the data from the client in a Transfer Object to update the data in the data source 12

 Factory for Data Access Objects Strategy  highly flexible by adopting the Abstract Factory and the Factory Method  When the underlying storage is not subject to change from one implementation to another, this strategy can be implemented using the Factory Method pattern to produce a number of DAOs needed by the application 13

14  Factory for Data Access Object strategy using Factory Method

 When the underlying storage is subject to change from one implementation to another, this strategy may be implemented using the Abstract Factory pattern 15

16

17

 Enables Transparency  implementation details are hidden inside the DAO.  Enables Easier Migration  migration involves changes only to the DAO layer  Reduces Code Complexity in Business Objects  implementation-related code (such as SQL statements) is contained in the DAO and not in the business object 18

 Centralizes All Data Access into a Separate Layer  data access layer can be viewed as the layer that can isolate the rest of the application from the data access implementation  Adds Extra Layer  Needs Class Hierarchy Design  hierarchy of concrete products produced by the factories need to be designed and implemented  increases the complexity of the design 19

 Implementing the DAO pattern 20

 Using Factory Method Pattern 21

 Using Abstract Factory Pattern 22

23

24

25

26

27

28

29

 Transfer Object  A DAO uses Transfer Objects to transport data to and from its clients.  Factory Method and Abstract Factory  The Factory for Data Access Objects Strategy uses the Factory Method pattern to implement the concrete factories and its products (DAOs). For added flexibility, the Abstract Factory pattern may be employed as discussed in the strategies. 30

31