• Post Reply Bookmark Topic Watch Topic
  • New Topic

Example for seperating GUI(Swing) and db-logic  RSS feed

 
Kay Tracid
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
im looking for an simple example how to handle swing GUI and the db logic. can somebody help please? i wont to know what is the best way to design a project. an example with ejb's would be nice, too.
thanks a lot.
regards
kay
 
Chantal Ackermann
Ranch Hand
Posts: 508
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you won't get a simple example for ejb + swing, I suppose. you should think about creating a backend using ejb or some simpler technology for a start. this backend has to provide an API that enables clients to retrieve the data they are interested in (so basically it is better to start with the client and design the API of the backend as a result).
The client has some or one class that is the adapter to the backend and has a reference to one (or some) backend classes. (the less classes refer to each other the less work you will have whenever a change comes up.) this adapter will channel the data from the backend to client, and vice versa.
This way you can encapsulate the client from the server and vice versa. you can have several clients (swing, jsp, etc.) refering to the same backend, while the backends implementation can change in any way, unless the API public to the client does not change.
If you have no idea about client-server implementations you should start by a simple swing client and a little backend that uses jdbc to retrieve data from the database.
I hope this was of some help
Chantal
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!