Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / August 2006

Tip: Looking for answers? Try searching our database.

Swing/Echo2 design question

Thread view: 
Moiristo - 27 Aug 2006 15:41 GMT
I am creating an app in Echo2 (what strongly resembles swing), and I was
wondering what would be a clean implementation for handling actions in
this app. Now, when someone clicks a button, I usually tend to create an
anonymous class, because then I have all displayed components available
that I need. I think however that this often isn't a nice way to do it.
Other possibilities are for example an inner class (actionlistener), or
even a separate class. How do I choose between these three approaches? I
think I forgot because my previous app was in JSF :).
John Gagon - 27 Aug 2006 22:45 GMT
> I am creating an app in Echo2 (what strongly resembles swing), and I was
> wondering what would be a clean implementation for handling actions in
[quoted text clipped - 4 lines]
> even a separate class. How do I choose between these three approaches? I
> think I forgot because my previous app was in JSF :).

I'd like to know myself. I'm hoping they get Echopoint up to the new
version soon. Please explain "clean implementation for handling
actions". Anonymous instantiations seem to
work fine in Screen objects or various component objects. It has a
Listener/Event/Model fire and handle approach that is pretty commonly
understood AFAIK. Only for more complicated things could you use some
kind of Listener implementation class, instantiated it and handle it
all in the Listener class. Might call it an Adaptor or something if
specific to your code IIRC. Someone correct me if I'm wrong on that.
JSF seems to be heavily tag dependant and I know where you are coming
from there. Going from markup style to a completely java class centric
approach with event listening instead of direct passing seems to play
with the brain's thinking. There is temptation to make direct calls
with it's dependency creating effects instead of registering listeners
and firing/handling events that encapsulate just enough information to
do the job. The event model is very elegant but can be a bit a "heavy".
If you can get away with less classes (and anonymous counts) or
something more generic..or resimplified, the better. The nice thing is
that events tend to be small and the Echo framework good about allowing
control over client chattiness.

John


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.