• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Need help on design!!

 
Ranch Hand
Posts: 202
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,
My Name is Muhammad Asif and working on an java solution. I want to discuss the design that i have developed for the Managerial portion of my module.
Basically, on the Manager side i am giving a Java Swing Interface.
Now with every interface i have attached a Mediator/Helper that does some helping work for it and also
communicates with the application handler.
For every screen i have a screen identity.
Then For each action i have an event.
When a certain event occurs, the mediator calls the ApplicationHandler on the client side.
The Application Handler with the help of service locator locates the Controller EJB.
All the data that i am sending to the server side is in hash map.
I have key value pairs.
(This is the first thing that i want to ask. Is this ok ?? because I will also need to store videos in the server side database. Will it be possible to send Videos encapsulated in a HashMap).

The controller EJB has one method that will handle all request from all modules.
The signature is
public DataPacket handleEvent(Event event,Identity identity,DataPacket dataPacket)
Where dataPacket is actually extending HashMap.
Now against this event and identity i make a call to teh database and look for the Action that needs to be generated. Action will basically be a class. For each event their is a corresponding Action Class.
The action class is instantiated and the perform() method is called for the appropriate action class.
in the perform method i am passing DataPacket and the result is also a DataPacket.

Then from the Action Class i call the DAOFactory to give me the Set of DAOs. If i need to use
Oracle Database i'll instantiate OracleDAOFactory else some other for the appropraiate database/
If some one who knows good enough about design tell me weather this design is correct. Or should i make any changes to it.
I am in particular interested in the fact that I am sending a complete DataPacket to the server side.
Which means for Videos i'll need to generate a byte array and send them on to the server side.

Asif
( I am not currently Using EJBs extensively and I donot want to use them either {at the moment that is} )
[ October 28, 2002: Message edited by: Muhammad Asif ]
 
Muhammad Asif
Ranch Hand
Posts: 202
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ne Body Home !!!
 
author
Posts: 3892
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, yes, everything you send to the server must be serializable... Is that your question? Or is it more a question of layering? Personally, I abhor putting UI controller logic on the EJB side like you've done. It's OK to put domain-style commands on the EJB side, but you've tightly coupled your UI events to your domain commands, which limits the utility of your controller EJB.
Instead, why don't you investigate the Session Facade pattern from the Core J2EE patterns book and see if you couldn't apply that...
Kyle
 
Muhammad Asif
Ranch Hand
Posts: 202
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well yes the question was about coupling and the distribution of layers.
As regards coupling i think that the controller will be usable in other applications 2 where the same kind of design is applied.
The reason is that the controller has
merely 7-8 lines of code. All it does it that extracts the actions to perform from the database,
Which afterwards can be transferred to XML documents.
Regarding Session Facade, yes that will be some what useful. I thought of implementing it in the first place but then I thought what will be the function of controller. It will recieve the events and identities from the session bean and just perform the appropriate action. This is very very small responsiblity and i will have to make one extra call (Although it might be within the same container/server) but still one additional call for every action the user is performing ???
Hope u get my point ?
And yes thanx for responding

Still waiting for positive critisim
Regards
Asif
[ October 28, 2002: Message edited by: Muhammad Asif ]
 
It runs on an internal combustion engine. This ad does not:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic