The World Leader in Making Software Work Together ™ 1 © IONA Technologies 1998-1999 Part 2 (A) CORBA and Databases.

Slides:



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

Connecting to Databases. relational databases tables and relations accessed using SQL database -specific functionality –transaction processing commit.
Chapter 10: Designing Databases
COM vs. CORBA.
OOAD Using the UML - Use-Case Analysis, v 4.2 Copyright  Rational Software, all rights reserved 1/18 Use Case Analysis – continued Control Classes.
Distributed Systems Architectures
11 3 / 12 CHAPTER Databases MIS105 Lec14 Irfan Ahmed Ilyas.
Component-Based Software Engineering Introducing the Bank Example Paul Krause.
Introduction to Databases Transparencies
Advanced Distributed Software Architectures and Technology group ADSaT 1 Application Architectures Ian Gorton, Paul Greenfield.
Chapter 1 Introduction to Databases
RIZWAN REHMAN, CCS, DU. Advantages of ORDBMSs  The main advantages of extending the relational data model come from reuse and sharing.  Reuse comes.
Distributed Databases
Web Application Architecture: multi-tier (2-tier, 3-tier) & mvc
Introduction to Databases Transparencies 1. ©Pearson Education 2009 Objectives Common uses of database systems. Meaning of the term database. Meaning.
Introduction to Databases and Database Languages
Data Access Patterns. Motivation Most software systems require persistent data (i.e. data that persists between program executions). In general, distributing.
Objectives of the Lecture :
Enterprise Object Framework. What is EOF? Enterprise Objects Framework is a set of tools and resources that help you create applications that work with.
Advance Computer Programming Java Database Connectivity (JDBC) – In order to connect a Java application to a database, you need to use a JDBC driver. –
CHAPTER 9 DATABASE MANAGEMENT © Prepared By: Razif Razali.
Database System Concepts and Architecture Lecture # 3 22 June 2012 National University of Computer and Emerging Sciences.
1 J2EE Components. 2 Application Servers relieve the programming burden for business distributed components. They provide support for system level services.
Relational Database Concepts. Let’s start with a simple example of a database application Assume that you want to keep track of your clients’ names, addresses,
Understanding the CORBA Model. What is CORBA?  The Common Object Request Broker Architecture (CORBA) allows distributed applications to interoperate.
Chapter 1 Introduction to Databases Pearson Education ©
CS 474 Database Design and Application Terminology Jan 11, 2000.
CODD’s 12 RULES OF RELATIONAL DATABASE
Lecture Set 14 B new Introduction to Databases - Database Processing: The Connected Model (Using DataReaders)
CS 390- Unix Programming Environment CS 390 Unix Programming Environment Topics to be covered: Distributed Computing Fundamentals.
Lecture2: Database Environment Prepared by L. Nouf Almujally & Aisha AlArfaj 1 Ref. Chapter2 College of Computer and Information Sciences - Information.
New features for CORBA 3.0 by Steve Vinoski Presented by Ajay Tandon.
Chapter 12: Designing Databases
Chapter 18 Object Database Management Systems. McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Outline Motivation for object.
Lecture2: Database Environment Prepared by L. Nouf Almujally 1 Ref. Chapter2 Lecture2.
Hibernate Persistence. What is Persistence Persist data to database or other storage.  In OO world, persistence means persist object to external storage.
CE Operating Systems Lecture 3 Overview of OS functions and structure.
Lecture # 3 & 4 Chapter # 2 Database System Concepts and Architecture Muhammad Emran Database Systems 1.
CS370 Spring 2007 CS 370 Database Systems Lecture 1 Overview of Database Systems.
3-Tier Client/Server Internet Example. TIER 1 - User interface and navigation Labeled Tier 1 in the following graphic, this layer comprises the entire.
INFO1408 Database Design Concepts Week 15: Introduction to Database Management Systems.
Lecture Set 14 B new Introduction to Databases - Database Processing: The Connected Model (Using DataReaders)
Efficient RDF Storage and Retrieval in Jena2 Written by: Kevin Wilkinson, Craig Sayers, Harumi Kuno, Dave Reynolds Presented by: Umer Fareed 파리드.
Distribution and components. 2 What is the problem? Enterprise computing is Large scale & complex: It supports large scale and complex organisations Spanning.
3-Tier Architecture Chandrasekaran Rajagopalan Cs /01/99.
DATABASE MANAGEMENT SYSTEM ARCHITECTURE
Chapter 9 Database Systems © 2007 Pearson Addison-Wesley. All rights reserved.
Persistent State Service 1  Concept  Persistence is the ability of an object state to survive termination of the process in which the object executes.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 JSP Application Models.
Object storage and object interoperability
Introduction to EJB. What is an EJB ?  An enterprise java bean is a server-side component that encapsulates the business logic of an application. By.
Chapter 18 Object Database Management Systems. Outline Motivation for object database management Object-oriented principles Architectures for object database.
Java Programming: Advanced Topics 1 Enterprise JavaBeans Chapter 14.
Copyright © 2004, Keith D Swenson, All Rights Reserved. OASIS Asynchronous Service Access Protocol (ASAP) Tutorial Overview, OASIS ASAP TC May 4, 2004.
Copyright 2007, Information Builders. Slide 1 iWay Web Services and WebFOCUS Consumption Michael Florkowski Information Builders.
NETW3005 Virtual Memory. Reading For this lecture, you should have read Chapter 9 (Sections 1-7). NETW3005 (Operating Systems) Lecture 08 - Virtual Memory2.
1 10 Systems Analysis and Design in a Changing World, 2 nd Edition, Satzinger, Jackson, & Burd Chapter 10 Designing Databases.
CEN6502, Spring Understanding the ORB: Client Side Structure of ORB (fig 4.1) Client requests may be passed to ORB via either SII or DII SII decide.
EJB. Introduction Enterprise Java Beans is a specification for creating server- side scalable, transactional, multi-user secure enterprise-level applications.
What Should a DBMS Do? Store large amounts of data Process queries efficiently Allow multiple users to access the database concurrently and safely. Provide.
SQL Basics Review Reviewing what we’ve learned so far…….
Databases and DBMSs Todd S. Bacastow January 2005.
Data, Databases, and DBMSs
Dr. Awad Khalil Computer Science Department AUC
Lecture 1: Multi-tier Architecture Overview
Chapter 2: Operating-System Structures
Developing and testing enterprise Java applications
Dr. Awad Khalil Computer Science Department AUC
Chapter 2: Operating-System Structures
Presentation transcript:

The World Leader in Making Software Work Together ™ 1 © IONA Technologies Part 2 (A) CORBA and Databases

The World Leader in Making Software Work Together ™ 2 © IONA Technologies Background info on CORBA and Databases

The World Leader in Making Software Work Together ™ 3 © IONA Technologies Some recent CORBA changes POA - portable object adapter Servant Servant Manager Default Servant

The World Leader in Making Software Work Together ™ 4 © IONA Technologies Portable Object Adapter ORB POA ORB This is the conceptual view of a server!!..... a set of CORBA objects POA : the CORBA component that is responsible for adapting CORBA’s concepts of objects to a programming language’s concept of objects (servants)

The World Leader in Making Software Work Together ™ 5 © IONA Technologies Servant In a POA ORB, each CORBA object is represented by two objects –a CORBA object –a servant object ORB POA CORBA objectservant

The World Leader in Making Software Work Together ™ 6 © IONA Technologies CORBA objects So what are the CORBA objects used for –.... They must be created so that an object reference can be passed to clients. –They do not have to physically exist to handle a request... they are bypassed! –[ Some programmers like to use IDL interfaces rather than C++/Java/.... Interfaces between the internal components of their servers. They will keep the CORBA objects in place to handle local calls. ]

The World Leader in Making Software Work Together ™ 7 © IONA Technologies Servants and Databases This a very useful separation from our viewpoint –the servant can go into the database, while the CORBA object need not. Prior to the POA standard within CORBA, ORBs made different server-side choices. Some allowed this separation, while others didn’t.

The World Leader in Making Software Work Together ™ 8 © IONA Technologies Details - class hiararchy CORBA::Object FrontOffice Interface FrontOffice {..... }; ServantBase POA_FrontOffice FrontOffice_i IDL C++ CORBA object servant

The World Leader in Making Software Work Together ™ 9 © IONA Technologies Active Object Map By default, a POA has an Active Object Map that records each of the servants that it manages –maps from ID to servant pointer ORB servants Active Object Map POA

The World Leader in Making Software Work Together ™ 10 © IONA Technologies ORB POA Servant Activation Servants can be deactivated and activated without effecting their accessibility by clients servant

The World Leader in Making Software Work Together ™ 11 © IONA Technologies Details... ORB POA Servant Manager Object fault servant

The World Leader in Making Software Work Together ™ 12 © IONA Technologies Object References, Keys and IDs Objects are identified as follows: Reference Key ID The ID must be sufficient to locate the servant –e.g., in the database The Servant Manager can choose the ID –the “object’s” key in an RDBMS –the object’s identifier in an ODBMS

The World Leader in Making Software Work Together ™ 13 © IONA Technologies Kinds of things Part 2 (B)

The World Leader in Making Software Work Together ™ 14 © IONA Technologies Kinds of CORBA objects Transient CORBA objects –often their servants don’t have persistent state. –They do not outlive the server process they may even have a shorter lifespan –E.g., an iterator over the result of a query –A client cannot safely hold a reference for a long period of time Persistent CORBA objects –Clients can safely hold references for long periods –they may be static in the server, or incarnated when needed. Don’t put them in the Naming Service

The World Leader in Making Software Work Together ™ 15 © IONA Technologies Kinds of Servants Stateful –has application level state Stateless –has no application level state –but may hold a database key so it knows what changes to make to the database –a stateless object can be removed from memory without loosing data

The World Leader in Making Software Work Together ™ 16 © IONA Technologies Advantages of Stateless Servants They can easily be removed from MM The database is updated during each modifying operation call –so queries against the database will see up to date information Disadvantages no caching of data at the application level. We depend entirely on the DBMS

The World Leader in Making Software Work Together ™ 17 © IONA Technologies Types of Database Integration Load objects statically –these can read/modify data in the DB to initialize themselves, and/or to implement their operations A CORBA object loading another from the DB in preparation of an invocation being made on it Loading CORBA objects from the DB when invocations are made to them

The World Leader in Making Software Work Together ™ 18 © IONA Technologies Loading (cont) interface FrontOffice { typedef long BookingID; BookingID makeBooking (.....); }; interface Booking {.....}; interface FrontOffice { Booking makeBooking (....); }; FrontOffice - statically load. Booking - Load objects when they are invoked upon. interface Booking {.....}; interface FrontOffice { Booking makeBooking (.....); Booking getBookingByID (....); }; Statically load the FrontOffice object FrontOffice - statically load. Booking - load objects in getBookingByID. - make them transient CORBA objects.

The World Leader in Making Software Work Together ™ 19 © IONA Technologies Use of POAs Part 2 (C) POAs allow you to create high performance and scalable systems Smaller systems will make very simple use of POAs

The World Leader in Making Software Work Together ™ 20 © IONA Technologies POA’s Active Object Map Recall the default way that objects are found: ORB servants Active Object Map POA Lookup

The World Leader in Making Software Work Together ™ 21 © IONA Technologies Introduce a Servant Manager... to handle object faults by activating the servant ORB servants Active Object Map POA Servant Manager (Servant Activator) Lookup fails

The World Leader in Making Software Work Together ™ 22 © IONA Technologies ORB servants Servant Manager (Servant Activator) POA The Servant Manager may use a table of some sort to find the servants or it may be able to find them in some other way.... But the Active Object Map may be inappropriate Select a policy that removes it:

The World Leader in Making Software Work Together ™ 23 © IONA Technologies Eviction Servants can be deactivated when the invocation is finished or they can stay activated –... and be deactivated later –e.g., if the server is running out of memory then some servants can be chosen to be evicted This is easier for stateless servants.

The World Leader in Making Software Work Together ™ 24 © IONA Technologies Evictor Pattern Record all of the currently loaded servants. Load a servant on demand –but remove an existing one if you don’t have the space to load the newly required one Use some “victim selection algorithm” –e.g., fixed size pool, and LRU If the Servant Manager maintains the Object Map then it can implement the Evictor Pattern itself –if the POA maintains its Active Object Map then the servants must also be involved in the pattern implementation

The World Leader in Making Software Work Together ™ 25 © IONA Technologies Could we survive with just one Servant Use a “default servant”.... a catch all ORB Default servant POA POA’s Active Object Map is optional. The default servant uses POA calls to determine the identify of the target object -- and assumes it’s identify for the duration of the call (or passes the call to another object to handle it).

The World Leader in Making Software Work Together ™ 26 © IONA Technologies Multiple POAs you can have multiple POAs per address space Each POA represents a grouping of objects with similar characteristics Each POA has a policy that controls –whether an active object map is maintained –servant manager or default servant or neither –ID management: application or system –thread allocation : single or multi –transient or persistent CORBA objects –etc. E.g., you may have a POA per DB; – or per type; etc

The World Leader in Making Software Work Together ™ 27 © IONA Technologies An aside : BOA ORBs Similar support, but it’s proprietary Orbix 3 –Uses loaders/filters to write object adapters allocate object keys handle object faults control transactions (if OTS isn’t used)

The World Leader in Making Software Work Together ™ 28 © IONA Technologies Databases not just Persistent Stores So far, much of what we have said relates to Persistent Stores as much as it does to DBMSs For DBMSs, we must add support for –queries –transactions

The World Leader in Making Software Work Together ™ 29 © IONA Technologies Queries Affect the caching mechanism –if we cache data in MM objects, and we don’t have exclusive access to the DB then we need to flush the data at the end of each transaction (also after each update if the server itself wants to make a query)

The World Leader in Making Software Work Together ™ 30 © IONA Technologies Transactions The OTS (Object Transaction Service) will co-ordinate commits across multiple DBs. You can also introduce your own Resource Manager to co-ordinate rollbacks to cached data –and register this with the co-ordinator. –This is real rocket science stuff.

The World Leader in Making Software Work Together ™ 31 © IONA Technologies Why integrate CORBA and Databases? Part 2 (D)

The World Leader in Making Software Work Together ™ 32 © IONA Technologies CORBA and Databases There are two views of why CORBA and Databases need to be integrated –from the CORBA viewpoint –from the Database viewpoint From the CORBA viewpoint –There is an obvious need to store the data of FrontOffice objects in some database so that the current state of the bookings for the theater can be recorded 1 1

The World Leader in Making Software Work Together ™ 33 © IONA Technologies From the Database viewpoint –You wish to gain the benefits of CORBA ease of working across operating systems ease of working across programming languages ease of programming distributed systems messaging technology legacy system integration tight connection to Windows OLE standards based distribution light-weight clients 2 2

The World Leader in Making Software Work Together ™ 34 © IONA Technologies Distributed ODBMS Some DBMSs do not support distribution But many do –this support for distribution is different to the CORBA model in fact they compliment each other very well. Data transfer Client Application Machines Storage Machine(s) Distributed Object DBMS

The World Leader in Making Software Work Together ™ 35 © IONA Technologies Issues Can the clients run on small machines? Will the system scale if the data contention between clients is high? Will it run over a WAN? Is the complexity of the data manipulation at the client sufficient to justify the data transfer to the client? Is it OK to write all of the clients in the same programming language? (or the few languages supported by the chosen OODBMS?) Can the clients be written to closely tie-in with OLE? –can we access the database from VBA in Excel? Can you bridge all boundaries? –A stock exchange wants to publish an interface and not say how it is implemented Q

The World Leader in Making Software Work Together ™ 36 © IONA Technologies Light-weight Clients using CORBA Data transfer Client Application Machines Storage Machine(s) –clients send operation invocations –all of the advantages of CORBA (bridging boundaries; interfaces; msg; standards;... ) –you are publishing interfaces, not implementations CORBA Servers -- direct access to data Operation calls

The World Leader in Making Software Work Together ™ 37 © IONA Technologies Distributed RDBMS SQL queries executed in clients Data transfer Same advantage of adding CORBA as with ODBMS: bridging boundaries exposing interfaces, not implementations we are not exposing a database schema messaging technologies, etc. or

The World Leader in Making Software Work Together ™ 38 © IONA Technologies Light-weight Clients - summary SQL queries or data transfer Operation calls Distributed RDBMS The clients don’t even know if we are using a RDBMS or ODBMS ! Data transfer Operation calls Distributed ODBMS CORBA servers clients Storage Machine(s)

The World Leader in Making Software Work Together ™ 39 © IONA Technologies Storing objects in RDBMS : 4 tasks decide on the mapping from OO view to relational view implement this mapping load objects on the fly if data is cashed in objects then –flush the cache when a transaction commits and discard it when a transaction aborts –or may have to write-through on each modification.

The World Leader in Making Software Work Together ™ 40 © IONA Technologies Code Generation Part 2 (E)

The World Leader in Making Software Work Together ™ 41 © IONA Technologies Code Generation Relational schema  C++ classes  IDL interfaces “ Do it by hand! “ -- no way! Won’t it be nice to push a button to generate the code to go from schema to IDL. Fine -- but be warned that the results mightn’t be very pleasing

The World Leader in Making Software Work Together ™ 42 © IONA Technologies Consider the following tables What IDL would you get? BookingIDDateBookingIDSeatNum BookingDateBookingSeat

The World Leader in Making Software Work Together ™ 43 © IONA Technologies Perhaps.... typedef long BookingID; interface BookingDate { attribute BookingID theBookingID; attribute Date theDate; }; interface BookingDateMng { // operations to create and delete “rows” }; interface BookingSeat { // definition of SeatNum; attribute BookingID theBookingID; atrtribute SeatNum theSeatNum; }; interface BookingSeatMng { //operations to create and delete “rows” };

The World Leader in Making Software Work Together ™ 44 © IONA Technologies What happened our Business Object layer?... with operations such as makeBooking(.... ); getBookingByName (.... ); Code generation (schema  IDL) is very useful but typically the code should be encapsulated by a higher layer within the server –so schema  C++ or Java may be just as useful.

The World Leader in Making Software Work Together ™ 45 © IONA Technologies CRUD schema  IDL automatic code generation can be useful for very simple systems –for so called CRUD interfaces –Create –Read –Update –Delete but the interface exposed to clients will be very low level [no usage patterns !!] and it may perform badly.... See over...

The World Leader in Making Software Work Together ™ 46 © IONA Technologies Always be careful of “data objects” Consider a table with many fields The auto-generated IDL is likely to provide separate operations to retrieve each field.... an order of magnitude slower than retrieving all in one call.

The World Leader in Making Software Work Together ™ 47 © IONA Technologies What about the other direction ? IDL  relational schema The issue is that IDL doesn’t define data members –it defines operations and attributes, but attributes need not correspond to data members In CORBA, PSS is one way to tackle this...

The World Leader in Making Software Work Together ™ 48 © IONA Technologies PSS Persistent State Specification - one of the CORBA services. It helps you to implement servants that have persistent state. –The fact that PSS is used in a server is not visible outside of the server. –PSS is of no concern to clients.

The World Leader in Making Software Work Together ™ 49 © IONA Technologies PSS (cont) PSS defines a new language, PSDL –Persistent State Definition Language –you can specify state independent of the chosen programming language –It’s a superset of IDL adds syntax to specify state, keys, etc. Or can specify the persistent state in C++ or Java. PSS defines operations to flush memory, refresh a cache, load objects by key. It supports embedded objects, references,...

The World Leader in Making Software Work Together ™ 50 © IONA Technologies C++/Java  relational schema There are many commercial products that do this –and some provide extras such as caching These can be directly used by a CORBA application C++ layer RDBMS IDL layer CORBA objects Servants Tables

The World Leader in Making Software Work Together ™ 51 © IONA Technologies Persistence in EJB An EJB impl can automate a lot of the work – For example, a combined CORBA + EJB system Java layer RDBMS IDL layer CORBA objects Servants Tables Automatic, but may have to be enhanced by the programmer. Automatic, just implement the business logic

The World Leader in Making Software Work Together ™ 52 © IONA Technologies Automatic Mapping - summary there are many mapping techniques –Relational  C++ / Java –Relational  IDL –PSDL  Java implementation on RDBMS –PSDL  C++ implementation on RDBMS –Java  relational with automated support for CORBA + EJB layer

The World Leader in Making Software Work Together ™ 53 © IONA Technologies (cont) Use these automatic code generators, but invest the freed time at the design level –and be prepared to augment the results Remember than none of these mapping techniques remove the need for proper IDL design –the client interface must be easy for clients to use, and it must perform well with the typical usage pattern. None of them remove the need for a proper business object layer