View stunning SlideShares in full-screen with the new iOS app!Introducing SlideShare for AndroidExplore all your favorite topics in the SlideShare appGet the SlideShare app to Save for Later — even offline
View stunning SlideShares in full-screen with the new Android app!View stunning SlideShares in full-screen with the new iOS app!
Basic RMI Architecture:<br />RMI (Remote Method Invocation) is a standard for distributed objects. It is a remote procedure call (RPC), which allows objects (software components) stored in the network to be run remotely.<br />Basic RMI(Remote Method Invocation) architecture mainly has the following four modules:<br />
Communication module(CM): Responsible for creating connections with other process, send or receive request /reply and maintain a queue for request and replies.
Skeleton & dispatcher on server side/proxy per remote object on client side: Dispatcher pick request from the queue of communication module and send to appropriate skeleton, It is also responsible for marshalling and unmarshalling messages. On the other hand proxy provides an interface to call methods of remote objects.
Remote Objects: Remote Objects are objects that can receive call from other process on different machine.
Remote Reference Module(RRM) : This module contains the reference of remote objects on the server side and references of proxies on client side.
Naming Service: There is another process involved in RMI called Naming Service, this process maintains a list of remote object’s references and their locations. <br />Fig 1: Basic RMI architecture<br />Our project: <br />We have to develop an online bookstore. The purpose of this project is to implement the basic RMI system. At the end of the project, we hope to develop a middleware that can support calling of distributed object over a network.<br />Architecture of Online Bookstore: Our prototype of Online Bookstore System has four main parts. <br />
Part I (Client Program):<br />Our client program has four modules implemented like RMI architecture with the classes shown in the following figure.<br />Fig 2: Client Program<br />Client /User Program:<br />Our client program comprises of menu system (user Interface), proxy classes, Remote Reference Module (RRM) and Communication Module (CM).<br />Client Interface comprises of 3 basic menus. They are following.<br />
Proxy Classes:<br />There will be two Proxy Classes in Client side The BookStoreProxy and BankAccountProxy.<br /> <br />Fig 2a: BankAccount Proxy Class Design Fig 2b: BookStoreProxy Class Design<br />Remote Reference Module:<br />Remote Reference module will have references for all Proxies<br />Fig 3: Remote Reference Module for Client side<br />Communication Module:<br />This module is responsible for creating sockets and send/receive request/reply. <br />Fig 4: Communication Module for Client program<br />Part II: Bookstore Server Program<br />The Bookstore server program is an remote object. Fig 5. gives the overview the Bookstore program. The Bookstore program has following modules.<br />
Fig 5: BookStore Server Program<br />Communication Module:<br />It is responsible for creating sockets, send /receive, request/reply and maintains pool <br />Fig 6a: Server CommModuleFig 6b: Pool Class Structure.<br />Skeleton Dispatcher:<br />Fig 7 : Skeleton & Dispatcher Design<br />Remote Objects:<br />The Bookstore Server will have 3 Remote objects namely Bookstore , Book and Shopping cart.<br />Fig 8a. Bookstore ProgramFig 8b. Book Class design<br />Fig 8c : Shopping Cart Class Design.<br />Remote Reference Module:<br />The remote reference module of the Bookstore program will have a list of Books and BookStore as remote object. The design is given in fig 9.<br />Fig 9: Remote Reference module for Bookstore Program (serverside)<br />Part III: Bank Server Program<br />The Bank Server program is be another remote object. So, We have considered as another different module. Fig 10. gives an overview of the Bank Server Program. Bank Server program will have the following modules.<br />
Fig 10: Bank Server Program<br />Skeleton & Dispatcher:<br />The Delegate method will dispatch request from communication module and will do unmarshalling and delegate o the method of the appropriate object. Fig 11 is a overview of Skeleton & Dispatcher for Bank Service program.<br />Fig 11: Skeleton and Dispatcher for Bank Service program<br />Remote Reference Module:<br />The Remote Reference Module for Bank Service has a list of Bank Objects. Fig 12 is an overview for Remote Reference Module.<br />Fig 12: Remote Reference Module for Bank Service program<br />Remote Objects:<br />Bank Service program for remote objects are Bank & Bank Account. Fig 13a and 13b illustrate them.<br />Fig 13a: Bank Object for Bank ServiceFig 13b: BankAccount Object for Bank Service<br />Part IV : Naming Service<br />Naming service is the last module of our design. It is responsible to provide the Remote Reference (Ex. IP , port etc) for remote objects. Fig 14a and Fig 14b gives an overview of our Name Service program.<br />Fig 14 a: Name Server program<br />Fig 14b: Name Class <br />Use Case Analysis of the project:<br />Besides the design of the RPC system we have also prepared a use case diagram which will help us separate the functionalities of the project. The use case of the Online Bookstore System is provided in the following section.<br />Use Case Diagram for Online Book Store System:<br />Fig 15. provides a use case diagram of the system and the details of the use case is provided in the following sections.<br />Actor of the system: This system has three actors namely Customer , BookStore and Banking System. The description of each of the system is provided below.<br /> Fig 15:Use case of Online Book Store<br />1) Customer: Customer is the end user of Online Book Store System. Customer initiates various operation and use various use cases in this system like ‘Search Book’, ‘Add Book’, ’Remove Book’ etc. <br />2) Book Store System: The Book Store System is an actor of theSystem and handles various book store related operations. It uses various use cases like ‘calculate price’, ‘Validate and Adjust Book Quantity’, ‘Manage Book store’ and ‘Book Inventory Control’.<br />3) Banking System: Banking system is another actor in the system which handles all bank related operations. It uses various use cases like ‘Valid Account’, ’Manage account’ etc.<br />The Description of different Use cases in the system are given below<br />
Create Shopping Cart: This use case is responsible creating a shopping card in the Bookstore program. As soon as a customer log into the bookstore program as shopping card will be created for the tracking of ther customer’s purchase.
Search Book: This use case is responsible for searching a book in the Book Store program. Searching a book can be in two means. Search by Author name and search by title of the book.
Add Book: This use case is responsible for adding a book in the Shopping cart.
Remove Book: This use case is responsible for deleting a book from the from the shopping cart.
CheckOut: This use case is responsible for checkout all the purchased books from the shopping cart. All corresponding transaction will occur in this phase. We will charge the user by the amount of all books and this amount will be deducted from the user’s bank account.
Deposit Amount: This use case is responsible for depositing some amount in the customers bank account. The Bank remote object is associated with this transaction.
Withdraw Amount: This use case is responsible for withdrawing some amount in the customers bank account. The Bank remote object is associated with this transaction.
DeleteBankAccount: In this use case we account for the case that a customer may delete his /her bank account.
CreateBankAccount: In this use case we account for the case that a customer may create a bank account.
Calculate Price: This case is responsible for calculating the price of all book being checkout from the shopping cart.
Validate & Adjust Book Quantity: This use case is responsible for validating the customer as well as the quantity of the available book in the bookstore.
Manage Book Account: There will be one bank account for the bookstore. After purchasing a book the corresponding amount will be deducted from the user and will be added to the bookstore’s bank account.
Book Inventory Control: In this case, we will manage the bookstore. Like when a new book arrive we will add it to the system and when the total quantity of a book gets to zero we will delete it from the bookstore.
Validate Account: In this case when a user provide his/her bank account we will check whether the account really exists and he/she has available balance.
Manage Bank Account: In this case we will provide features to add a new bank to the central bank and remove a bank from the central bank. Adding account to a existing bank is done under this use case.
Conclusion: <br />The Design so far we have done is based upon our conceptual on RMI. We think and believe that it will change as we begin to pin point more details. So far, we have tried with our best effort for the design of the program.<br />