Coder Social home page Coder Social logo

cst8277-assignment3's Introduction

CST8277 Assignment #3 - RMI and Hibernate

This assignment's purpose was to get familiar with RMI and Hibernate. This assignment is basically an "RMI-based 3-tier networked multi-user version" of Assignment #1 (Bouncing Sprites). The server handles the business rules (Sprite creation, movement, etc.), accesses the database, and tells the presentation layer (the client) to display the Sprites. Multiple clients can connect to the server at the same time and see the same number of Sprites and their movement, and each client has a different coloured Sprite associated with it (a randomly generated Color object basically). The Sprites are persistent objects in the database. The program functions the same as Assignment #1 although there is no black box this time.

SpriteClient.java has all the client code, which just connects to the server and retrieves a list of Sprites. On the server side, the bulk of the code is in SpriteImpl.java which implements an interface (SpriteInterface.java) to allow the creation of Sprites, the JPanel window size, the Sprite movement, and the Sprite colour. Each Sprite created is also stored in a database using Hibernate. The program also makes use of Oracle's MySQL Connector/J, and the server makes use of a database called "assignment03".

I also included a basic Class Diagram and Sequence Diagram.

Here's some instructions on getting the program running:

  1. Before launching program, run MySQL Server.

  2. Create user 'scott' identified by 'tiger' (or edit the "hibernate.cfg.xml" file with your own user) and grant the user the necessary permissions. Create a database called "assignment03".

  3. Run "SpriteWorld" to start the server. By default, it will use "localhost" as the hostname, however you can specify a specific host by adding an argument from the command line (e.g. "java server.SpriteWorld 196.168.0.2", which will consider the hostname to be 192.168.0.2).

  4. After having the server running, launch "SpriteClient" to launch the client. By default, it will use "localhost" as the hostname, however you can specify a specific host by adding an argument from the command line (e.g. "java client.SpriteClient 196.168.0.2", which will consider the hostname to be 192.168.0.2).

  5. After SpriteClient launches, you can then click anywhere within the window that pops up to create a Sprite at that location.

  6. To end the program, simply stop the server (SpriteWorld).

cst8277-assignment3's People

Contributors

richard1990 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.