Architecture of Oracle9i Advanced Queuing Sample

Table Of Contents 

Block Diagram 

Back To Top

Imagine that there exists a Retail Shop which serves various customers all over the world. This retail shop sells several different products in several different categories. To do so, this retail shop has tied with several product manufacturers which essentially form business partners of this shop. These business partners include manufacturers of Computers, Mobile Phones, Printers, Handheld Devices, etc...
Our Retail Shop has direct contact with these companies and sells their product directly to customers. 

Each of these manufacturers maintain their own databases which is at a different physical location than our retail shop's database. So, both of these databases will communicate to each other through Message Propagation. 

As the Retail Shop sells products all over the world, the currency involved is different depending on the country the customer belongs to. For our enterprise to serve all these customers effectively, business transaction has to be done in the customers own currency. For this, we will use the feature of Message Transformation provided in AQ. 

For the delivery of purchased products there is a Delivery module. This module gets automatically notified about the product to be delivered through the use of PLSQL Notification. 

Now, let us go into each of these in more detail. Please refer to the block diagram provided ( Figure 1 ). 
 
 


Figure 1







Whenever there is a change in a product price or a new product has been manufactured, the manufacturer just updates its own local Database. Through Message Propagation, this change will be     communicated to the Retail Shop's Database automatically and the tables will be updated accordingly. For this, the sample will use the feature of "Automatic Message Propagation" in AQ. 

Now, when the customer enters the Retail Shop's web site, he/she can see all the products that can be ordered. These products can be from different manufacturers under different categories. The prices will be displayed in US Dollars. When the user orders for a single or multiple products, corresponding XML message will be generated and enqueued in the Database Queue using IDAP Protocol and AQ Servlet. This entry will be inserted in the Queue. 

When a new order comes, an E-mail Notification will be sent by the queue to the delivery module about the purchase. Through a PLSQL notification, the required tables will be updated. During PLSQL Notification, a Message Transformation will be applied and the price will  be converted in the User's local currency. The payment will be made by the customer on delivery of the products. This will be simple as the entered price is already converted to the users local currency. 

No charges will be made for the delivery. 
 
 

Database Design 

Back To Top

To see the database design used in the sample, please refer to Figure 2.

Figure 2



 
 
 
 
 
 

Sample Architecture 

Back To Top

The sample is divided into five layers namely; Presentation Layer, Controller Layer, Event Manager layer, Business Layer and DataBase Layer. You will find the layers similar to the MVC (Model-View-Controller) Architecture. Let us look into these layers in more detail. Please refer to the diagram provided (Figure 3)


Figure 3

Presentation Layer :  This layer consists entirely of JSP's. This is the layer which will actually interact with the user. Every request will come from this layer and the response will also be submitted to this layer. Each request from this layer is considered an event. In other words, we can say that every click on a button ( in a JSP ) generates an event which is then handled by the subsequent layers. The JSP's here will not at any time interact directly with any of the Java Classes, Beans or the underlying database. In essence, this layer forms the view of the MVC Architecture.

Controller Layer : This is the layer from which each and every request or response has to pass. This layer consists of a single servlet namely, ControllerServlet.java and a XML file namely, Control.xml. Control.xml is a XML file that consists information about different parameters to be called on a particular event.

Event Manager Layer : This is the layer where all the different type of events are managed. It consists of different Java classes and XML files. All the methods in the Java files take the HttpServletRequest object as one of the parameters. These methods call the Business Layer with appropriate parameters which return some object (Boolean, String, Vector or HashTable) depending on the event. This layer then updates the HttpServletRequest and HttpSession object, if required. Then the control is passed back to the ControllerServlet.java which forwards the request to a JSP page

Business Layer : This Layer contains various Business and Helper classes. All the classes in this layer will be stateless and will not have any global variables associated. For every event that can occur in this sample, a corresponding method will be contained in the classes here. Almost every event generated by the customer/admin, the flow will come to this layer as the actual processing will occur here. This is the layer that will contain all the business methods for the sample. The methods here will construct the database queries and pass it on to the DataBase Layer. The methods in Business Layer will get the Vector object from the DataBase Layer and will parse it and store the values in a HashTable, Enumeration etc.. as and when required. These object then will be returned to the Event Manager Classes which will act further on them appropriately.

DataBase Layer : This layer will connect to the DataBase physically. No other layer can connect to the database directly. Every request pertaining to the database has to go through this layer.

For more information on various XML and Java Classes contained in the layers, please refer to the comments/JavaDoc provided in the files. For creating JavaDoc for the files, please refer to Install.html.


Revision history:  May 29, 2002

Please enter your comments about this sample in the Sample Code Discussion Forum.


 
E-mail this page
Printer View Printer View
Oracle Is The Information Company About Oracle | Oracle RSS Feeds | Careers | Contact Us | Site Maps | Legal Notices | Terms of Use | Privacy