The Object-Oriented Thought Process Chapter 12

Slides:



Advertisements
Similar presentations
Object orientation and persistent objects Dragos Chirila Finsiel Romania Copenhagen, 24 May 2004.
Advertisements

File-based Persistence: Serializability COMP53 Dec 7, 2007.
Chapter 8: Introduction to High-level Language Programming Invitation to Computer Science, C++ Version, Third Edition.
Overview of Database Access in.Net Josh Bowen CIS 764-FS2008.
Object Oriented Databases by Adam Stevenson. Object Databases Became commercially popular in mid 1990’s Became commercially popular in mid 1990’s You.
Chapter 7 Designing Classes. Class Design When we are developing a piece of software, we want to design the software We don’t want to just sit down and.
DATABASE PROGRAMMING Lecture on 16 – 05 – PREVIOUS LECTURE QUIZ: - Some students were very creative in transforming 2NF to 3NF. Excellent! - Some.
©2007 · Georges Merx and Ronald J. NormanSlide 1 Chapter 10 Information Management in Java.
Streams Reading: 2 nd Ed: , rd Ed: 11.1, 19.1, 19.4
Chapter 14 - Designing Data Access Classes1 Chapter 14 Designing Data Access Classes.
Andrew S. Budarevsky Adaptive Application Data Management Overview.
Object Oriented Software Development 10. Persistent Storage.
Hwajung Lee.  Interprocess Communication (IPC) is at the heart of distributed computing.  Processes and Threads  Process is the execution of a program.
DAT602 Database Application Development Lecture 1 Course Structure & Background knowledge.
1 CSE 331 Memento Pattern and Serialization slides created by Marty Stepp based on materials by M. Ernst, S. Reges, D. Notkin, R. Mercer, Wikipedia
Hibernate Java Persistence API. What is Persistence Persistence: The continued or prolonged existence of something. Most Applications Achieve Persistence.
A service Oriented Architecture & Web Service Technology.
Mobile Application Development Data Storage. Android provides several options for you to save persistent application data. The solution you choose depends.
Chapter 2 Operating System Overview Dave Bremer Otago Polytechnic, N.Z. ©2008, Prentice Hall Operating Systems: Internals and Design Principles, 6/E William.
Introduction to Distributed Systems Slides for CSCI 3171 Lectures E. W. Grundke.
Java Web Services Orca Knowledge Center – Web Service key concepts.
Deployment Diagram.
Introduction to Computing Systems
Databases (CS507) CHAPTER 2.
The Object-Oriented Thought Process Chapter 13
Root I/O and the Gaudi Framework
Phil Tayco Slide version 1.0 Created Sep 10, 2017
The Object-Oriented Thought Process Chapter 14
IT Service Management – main terms and definitions
Deployment Diagram.
Datab ase Systems Week 1 by Zohaib Jan.
Distributed Computing
An Introduction to database system
WEB SERVICES.
SOFTWARE DESIGN AND ARCHITECTURE
The Object-Oriented Thought Process Chapter 1
IS444: Modern tools for applications development
Java Beans Sagun Dhakhwa.
Database Systems: Design, Implementation, and Management Tenth Edition
Chapter 11: File System Implementation
Distribution and components
IS444: Modern tools for applications development
Introduction to J2EE Architecture
Direct Attached Storage Overview
Socket Programming in Java
Deployment Diagram.
Storage Virtualization
Lecturer: Mukhtar Mohamed Ali “Hakaale”
Chapter 11: File System Implementation
Ch 15 –part 3 -design evaluation
Software Engineering Experimentation
The Object-Oriented Thought Process Chapter 05
Chapter 2: System Structures
Chapter 11: File System Implementation
Lecture 1: Multi-tier Architecture Overview
Serialization and Deserialization Bullet points from Head First Java, Ch Dec-18 serialization.ppt.
Coding Concepts (Data Structures)
Chapter 2: Operating-System Structures
CSE 331 Memento Pattern slides created by Marty Stepp based on materials by M. Ernst, S. Reges, D. Notkin, R. Mercer, Wikipedia
Introduction to Operating Systems
Operating Systems : Overview
Database Management Systems
Operating Systems : Overview
Database Connectivity and Web Development
Chapter 11: File System Implementation
Introduction to Web Services and SOA
Introduction to MySQL NELINET October 28th, 2005.
Chapter 2: Operating-System Structures
OO Java Programming Input Output.
Database management systems
Presentation transcript:

The Object-Oriented Thought Process Chapter 12 Persistent Objects: Serialization, Marshaling & Relational Databases

Persistent Objects The concept of saving the state of an object so that it can be used later is called persistence. Thus, we used the term persistent object to define an object that can be restored and used independently of a single application perhaps a database. Because the object is in persistent storage, other applications can access it.

Saving an Object to a Flat File One of the issues you might have considered is that an object cannot be saved to a file like a simple variable. The problem with an object is that it is not simply a collection of primitive variables. An object can be thought of as an indivisible unit that is composed of a number of parts. Thus, the object must be decomposed into a unit that can be written to a storage medium such as a flat file.

Decomposed & Reconstituted An object must be decomposed into a unit that can be written to a storage medium such as a flat file. After the object is decomposed and written to a flat file, there is one major issue left to consider - reconstituting the object, basically putting it back together.

Flat Files Many people are not totally comfortable with the term flat file. The word flat implies that the object is literally flattened, and in a way it is. You almost can think of this flattening process as necessary to store and transport an object, regardless of its complexity.

Serializing a File Modern languages have built-in mechanisms for object persistence. For example, like other C-based languages, Java often uses the concept of a stream to deal with I/O. To save an object to a file, Java writes it to the file via a Stream. To write to a Stream, objects must implement either the Serializable or Externalizable interface.

Implementation and Interface Revisited Serializing a file is yet another great example of the difference between the interface and the implementation. All you care about is the following: That you can write the object as an indivisible unit. That you can restore the object exactly as you stored it.

What About the Methods? In the case of the Java serialization example, the methods are not explicitly stored. Remember that we indicated that Java had to be at both ends of the “pipe.” In actuality, the class definitions that you are using have to be on both ends of the “pipe” as well.

Using XML in the Serialization Process Although using a proprietary serialization technique may be efficient and compact, it is not portable. XML is the standard for defining data, so we can create an XML model of our serialization example that can, at least theoretically, be used across various platforms and languages.

Writing to a Relational Database Although relational databases are a wonderful technology, they provide a bit of a problem when it comes to interfacing with objects. Just as with the issue of writing to a flat file, taking an object that may be composed of other objects and writing it to relational databases, which are not designed in an object-oriented manner, can be problematic.

Legacy Data Legacy data may be decades of data that are stored in various storage devices. We consider legacy data to be the historical data stored in relational databases. Many people don’t like the term “legacy” because they think it implies obsolete. In fact, important legacy data is not obsolete but an important part of the system.

Object-to-Relational Mapping A piece of software that resides between object-oriented applications and relational databases is often called middleware. As an example, let’s use Java to communicate to a Microsoft Access database, which is a relational database. Java uses JDBC (Java Database Connectivity) to communicate with database servers.