Lec 1 - University of Sydney

Download Report

Transcript Lec 1 - University of Sydney

Integration case study
Week 8 – Lecture 1
New University Student Record System
(all servers are on separate hosts)
Enrolment
request
(Workstation)
IT School
Marking system
Application
server
Application
Database
server
Database
Database
Some background
• The SRS
– Is written in Java,
– The DBMS is Oracle
– There is only one application server host and one
database server host
– It is not a WEB based system
• The IT School marking system
– Is written in C
– The DBMS is Sybase
A student enrolling in a new subject will
effect the following steps
1.
2.
3.
4.
The student will enter his/her SID and the unit code he or she wants
to enrol in.
The Enrolment request process, will send a message to the
Enrolment process
The Enrolment process will access the Database to ensure
– The SID is valid
– The student is permitted to take this course
The Enrolment process will now
– Instruct the Database server to update the database
– Confirm the change to the Enrolment request process
– Advise the IT School marking system of the addition.
How does the Enrolment request process, send a message to
the Enrolment process?
By RMI (Remote Method Invocation) Note that J2EE offers
other alternative approaches.
• It constructs a message along the following lines
enrolment.add (2000123456,ISYS2007)
• Note this is written as if the process was local. The message is passed to a
stub process on the same client host. (This stub was created by the RMI
compile process.)
• The stub collect the arguments, and accesses the registry to obtain the
address of the server containing the remote process and the port number
of that process
• The stub process then sends the message on to the skeleton process on the
server via the transport/network etc layers of the network architecture.
• That skeleton then passes the message to the server process.
• Because both client and server processes are Java, any incompatibility of
data types due to the host hardware is handled by the Java Virtual
Machines on both hosts.
How does the Enrolment process find and
access the database?
Via JDBC and SQL
• We know that the primary language for accessing a
RDBMS is via SQL
• However we also need to
– Establish a connection with the actual instance of the database we
want to access.
– Provide the interface between our process on the application server
host and the DBMS process on the Database server host
– This is carried out by the JDBC driver but initiated by the Java
code in the Enrolment process – we can hard code the URL of the
database, but that is inflexible
• We can now create and execute SQL within our Java code
and pass it to JDBC
• JDBC in turn uses the network layers to pass messages
containing the SQL to the DBMS and return the result sets.
Enrolment
request
(Workstation)
RMI Stub
Network stack
Registry
Network stack
Contains the URL
for the process
we need to invoke
JMI Skeleton
Enrolment
Process
JDBC driver
Network stack
In this example the process
holds the URL of the instance
of the database to be
accessed
Network stack
JDBC interface
SQL processor
Database
How does the SRS pass new enrolments to the
IT School marking system?
• We have a number of options, here are some
– Write a record to an interface file which can then be
picked up from a predetermined directory and
processed by the marking system in batch mode
– The SRS enrolment process could update the Marking
system database directly using ODBC
– The SRS process could invoke a process in the Marking
system to get it to update the Marking system database.
– The SRS could publish changes of any type to its
database and allow other authorised systems to
subscribe i.e. each system could select the changes it
was interested in and process them against its database
Write a record to an interface file which can then be
picked up from a predetermined directory and
processed by the marking system in batch mode.
Interface file
Marking system
Enrolment process
Database
server
Database
Database
2001123456,BIT,Add,ISYS2007
2000654321,BSc,Delete,INFO1003
1999876543,BCST,Add,SOFT1000
etc
• Easy to implement
• No transactional integrity - asynchronous
• The Marking system has to make any data transformations e.g. to take
off the first two digits of the SID
• Any change in the interface requires both systems to change programs
The SRS enrolment process could update the Marking
system database directly using ODBC, or
the SRS process could invoke a process in the Marking
system to get it to update the Marking system database.
Enrolment process
ODBC
JDBC
Database
server
Marking system
Database server
Database
(Sybase)
Database
(Oracle)
• Transaction integrity - synchronous
• High degree of integration – maybe central IT group does
not want that responsibility.
• Places restrictions on what the IT school does with its
marking system.
• Data transformations more difficult.
The SRS could publish changes of any type to its database and
allow other authorised systems to subscribe i.e. each system could
select the changes it was interested in and process them against its
database
Marking system
Enrolment process
Database
server
•
•
•
•
Database
(Oracle)
Database
(Sybase)
<enrolmentchange>
<sid>2000123456</sid>
<degree>BIT</degree>
<type>add</type>
<unit>ISYS2007</unit>
</enrolmentchange>
Standard IDL (XML) – Published structure - Schema
Asynchronous
Only required fields need be selected by the Marking system - XSLT
Changes can be made to published interface without changes having to
be made to Marking system (as long as elements the marking system
needs are not removed)
• Connectors carry out transformations. These include procedural code
as well as executing XSLT