OOPSLA Lab1 Chapter 7 Java Binding Prof. Hyoung-Joo Kim OOPSLA Lab. Dept. of Computer Engineering Seoul National University.

Slides:



Advertisements
Similar presentations
Chapter 23 Organizing list implementations. This chapter discusses n The notion of an iterator. n The standard Java library interface Collection, and.
Advertisements

Transparency No. 1 Java Collection API : Built-in Data Structures for Java.
Lists and the Collection Interface Chapter 4. Chapter Objectives To become familiar with the List interface To understand how to write an array-based.
Chapter 7 User-Defined Methods. Chapter Objectives  Understand how methods are used in Java programming  Learn about standard (predefined) methods and.
Object Databases Baochuan Lu. outline Concepts for Object Databases Object Database Standards, Languages, and Design Object-Relational and Extended-Relational.
ODMG Standard: Object Model1 OBJECT-ORIENTED DATABASE SYSTEMS ODMG Standard: Object Model Susan D. Urban and Suzanne W. Dietrich Department of Computer.
CS 326 Programming Languages, Concepts and Implementation Instructor: Mircea Nicolescu Lecture 18.
George Blank University Lecturer. CS 602 Java and the Web Object Oriented Software Development Using Java Chapter 4.
Road Map Introduction to object oriented programming. Classes
ISBN Chapter 6 Data Types: Structured types.
Encapsulation by Subprograms and Type Definitions
Object-Oriented Standards OMG OMDG. Overview Object Management Group (OMG) International non profit-making consortium founded in 1989 to address object.
Evan Korth New York University Computer Science I Classes and Objects Professor: Evan Korth New York University.
1 Pertemuan 17 Building Object Database Application Matakuliah: M0174/OBJECT ORIENTED DATABASE Tahun: 2005 Versi: 1/0.
Object Oriented Databases - Overview
Chapter Implementation Faithful translation of a design into a target environment Design should be free of target-environment dependencies Should.
1 Pertemuan 19 Building Object Database Application (Lanjutan bagian 2) Matakuliah: M0174/OBJECT ORIENTED DATABASE Tahun: 2005 Versi: 1/0.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 11 Object and Object- Relational Databases.
1 Announcements Research Paper due Monday November 22.
Databases Illuminated Chapter 7 The Object-Oriented Model.
Copyright © 2003 ProsoftTraining. All rights reserved. Sun Certified Java Programmer Exam Preparation Guide.
Differences between C# and C++ Dr. Catherine Stringfellow Dr. Stewart Carpenter.
Object and object-relational databases 1. Object databases vs. Object-relational databases Object databases Stores complex objects – Data + functions.
Advanced Database CS-426 Week 2 – Logic Query Languages, Object Model.
Principles of Computer Programming (using Java) Review Haidong Xue Summer 2011, at GSU.
Introduction to Java Appendix A. Appendix A: Introduction to Java2 Chapter Objectives To understand the essentials of object-oriented programming in Java.
Programming Languages and Paradigms Object-Oriented Programming.
Object Query Language (OQL) and Language Binding
DBMS Lecture 9  Object Database Management Group –12 Rules for an OODBMS –Components of the ODMG standard  OODBMS Object Model Schema  OO Data Model.
CSM-Java Programming-I Spring,2005 Objects and Classes Overview Lesson - 1.
Introduction to Object Oriented Programming. Object Oriented Programming Technique used to develop programs revolving around the real world entities In.
1 Spring 2000 Christophides Vassilis ODMG Object Programming Language Bindings.
Chapter 5 C++ Binding Prof. Hyoung-Joo Kim OOPSLA Lab. Dept. of Computer Engineering Seoul National Univ.
Chapter 21 A Object Data Model - Intro Copyright © 2004 Pearson Education, Inc.
Chapter 2: Object Model Prof. Hyoung-Joo Kim OOPSLA Lab. Dept. of Computer Engineering Seoul National Univ.
Jan 12, 2012 Introduction to Collections. 2 Collections A collection is a structured group of objects Java 1.2 introduced the Collections Framework Collections.
2000 Jordan Anastasiade. All rights reserved. 1 Class In this lesson you will be learning about: Class. Inheritance. Polymorphism. Nested and.
8 October, 2001DBIS4 - RLC108 Object Query Language The need for ad hoc querying What SQL does What OQL must do OQL syntax and examples.
1 Introduction Modules  Most computer programs solve much larger problem than the examples in last sessions.  The problem is more manageable and easy.
5-Aug-2002cse Arrays © 2002 University of Washington1 Arrays CSE 142, Summer 2002 Computer Programming 1
Lists and the Collection Interface Review inheritance & collections.
Session 08 Module 14: Generics and Iterator Module 15: Anonymous & partial class & Nullable type.
Chapter 21 Object Database Standards, Languages, and Design Copyright © 2004 Pearson Education, Inc.
1/20/03A2-1 CS494 Interfaces and Collection in Java.
1 Chapter 8 – Classes and Object: A Deeper Look Outline 1 Introduction 2 Implementing a Time Abstract Data Type with a Class 3 Class Scope 4 Controlling.
Chapter 3 Object Specification Languages Prof. Hyoung-Joo Kim OOPSLA Lab. Dept. of Computer Engineering Seoul National Univ.
1 Advanced Databases (CM036) – Lecture # 12: The ODMG Standard for Object Databases Object Query Language (OQL) & Language Binding Advanced Database Technologies.
OOPSLA LAB. 1 Chapter 4 Object Query Languages Prof. Hyoung-Joo Kim OOPSLA Lab. Dept. of Computer Engineering Seoul National University.
Inheritance. Inheritance - Introduction Idea behind is to create new classes that are built on existing classes – you reuse the methods and fields and.
Chapter 3 Collections. Objectives  Define the concepts and terminology related to collections  Explore the basic structures of the Java Collections.
Testing OO software. State Based Testing State machine: implementation-independent specification (model) of the dynamic behaviour of the system State:
UMass Lowell Computer Science Java and Distributed Computing Prof. Karen Daniels Fall, 2000 Lecture 9 Java Fundamentals Objects/ClassesMethods Mon.
 In the java programming language, a keyword is one of 50 reserved words which have a predefined meaning in the language; because of this,
AND OBJECT-ORIENTED DATABASES OBJECT-RELATIONAL DATABASES.
Interfaces and Inner Classes
The ODMG Standard for Object Databases
Object orientation and Packaging in Java Object Orientation and Packaging Introduction: After completing this chapter, you will be able to identify.
OOPSLA Lab.1 Chapter 6 Smalltalk Binding Prof. Hyoung-Joo Kim OOPSLA Lab. Dept. of Computer Engineering Seoul National University.
Java Programming Persistent Data Types. Persistent Data Structure A persistent data structure is a data structure having an internal state that never.
© 2006 Pearson Addison-Wesley. All rights reserved 1-1 Chapter 1 Review of Java Fundamentals.
Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe Chapter 12 Outline Overview of Object Database Concepts Object-Relational Features Object Database.
1 ODMG. 2 Object Database Management Group (ODMG) ODMG has been formed in late 1991 by: ObjectDesign, Ontos, O2 Technology, Versant, Objectivity, Digital.
UMass Lowell Computer Science Java and Distributed Computing Prof. Karen Daniels Fall, 2000 Lecture 10 Java Fundamentals Objects/ClassesMethods.
Chapter 21 Object Database Standards, Languages, and Design Copyright © 2004 Pearson Education, Inc.
Sixth Lecture ArrayList Abstract Class and Interface
Chapter 7 User-Defined Methods.
OBJECTS & DATABASES Arnaud Sahuguet – CIS-550.
Chapter 12 Outline Overview of Object Database Concepts
Java Programming Language
Presentation transcript:

OOPSLA Lab1 Chapter 7 Java Binding Prof. Hyoung-Joo Kim OOPSLA Lab. Dept. of Computer Engineering Seoul National University

OOPSLA Lab2 Contents 7.1 Introduction 7.2 Java ODL 7.3 Java OML 7.4 Java OQL

OOPSLA Lab3 7.1 Introduction(1) Language design principles –one principle perceive the binding as a single language for expressing both database and programming operation –several corollaries a single unified type system respect the Java language respect the automatic storage management semantics of Java Language binding –two ways to declare persistence-capable Java classes existing Java classes Java class declaration generated by a preprocessor for ODMG ODL

OOPSLA Lab4 7.1 Introduction(2) Use of Java language features –namespace the ODMG Java API will be defined in a vendor-specific package name –implementation extensions provide the full function signature for all the interface methods specified Mapping the ODMG object model into Java –object and literal ODMG object type maps into a Java object type ODMG atomic literal types map into their equivalent Java primitive types no structured literal types in the Java binding –structure the object model definition of a structure maps into a Java class –implementation interface and abstract classes cannot be instantiated

OOPSLA Lab5 7.1 Introduction(3) –collection classes the Java binding provides at least one implementation for each of the following collection objects public interface Set extends Collection {….} public interface Bag extends Collection {….} public interface List extends Collection {….} –array the ODMG array collection maps into either the primitive array type, the Java Vector class, or the ODMG VArray class –relationship not yet supported by the Java binding –extents not yet supported by the Java binding –keys not yet supported by the Java binding

OOPSLA Lab6 7.1 Introduction(4) –names objects may be named using methods of the Database class defined in the Java OML –exception handling an exception is thrown using the standard Java exception mechanism

OOPSLA Lab7 7.2 Java ODL Attribute declaration and types Relationship traversal path declarations –not yet supported in the Java binding Operation declaration –operation declarations in the Java ODL are syntactically identical to method declaration in Java

OOPSLA Lab8 7.3 Java OML(1) Object creation, deletion, modification, and reference –object persistence persistence by reachability : a transient Java object that is referenced by a persistent Java object will automatically become persistent –object deletion no notion of explicit deletion of objects –object modification modified persistent Java object will have their updated fields reflected in the object database –object locking support explicit locking using methods on the Transaction object Properties –uses standard Java syntax for accessing attributes and relationships Operation –defined as methods in the Java language

OOPSLA Lab9 7.3 Java OML(2) Collection interface –a comforming implementation must provide these collection interface Collection Set Bag List –interface Collection Public interface Collection { // Chapter 2 operations public int size(); // unsigned long cardinality() public boolean isEmpty(); // boolean is_empty() public void add(Object obj); // void insert_element(…) public Object remove(Object obj); // void remove_element(…) public boolean contains(Object obj); // boolean contains_element(…) public Enumeration elements(); // Iterator create_iterator(…) …….. }

OOPSLA Lab Java OML(3) Transaction –implemented as object of class Transaction –the creation of new transaction object implicitly associates it with the caller’s thread –class Transaction Public class Transaction { // Create new transaction object and associate it with the caller’s thread Transaction(); // Attaches caller’s thread to this existing Transaction; // any previous transaction detached from thread public void join(); ……… public void begin(); public void commit(); public void abort(); ……. }

OOPSLA Lab Java OML(4) Database operations –the predefined type Database represents a database –class Database Public class Database { // Access modes public static final int notOpen = 0; public static final int openReadOnly = 1; ….. // Returns the database the name specified. // Opens database if not already open. public static Database open(String name, int accessMode) throws ODMGException; public void close() throws ODMGException; // Named object binding and lookup public void bind(Object object, String name); public Object lookup(String name) throws ObjectNameNotFoundException; …… }

OOPSLA Lab Java OQL(1) Java OQL binding –support the full functionality of the object query language –two ways that use this functionality query method on class Collection queries using on a stand-alone OQLQuery class Collection query method –Collection interface has a query member function Collection query(String predicate) –example SetOfObject mathematicians; mathematicians = Students.query( “exists s in this.takes: s.section_of.name = \”math\” ”);

OOPSLA Lab Java OQL(2) OQLQuery class –allows the programmer to create a query –example class OQLQuery{ public OQLQuery(){} public OQLQuery(String query){…} // You can construct or.. public create(String query){….} // assign a query. public bind(Object parameter){…} public Object execute() throws ODMGException {…} } Bag mathematicians; Bag assistedProfs; Double x; OQLQuery query; mathematicians = Students.query(“exist s in this.takes: s.sectionOf.name = \”math” ”); query = new OQLQuery( “select t.assistants.taightBy from t in TA where t.salary > $1 and t in $2”); x = new Double( ); query.bind(x); query.bind(mathematicians); assistedProfs = (Bag) query.executed();