• 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

NX: concerning the GUI-level, please help!!!

 
Ranch Hand
Posts: 266
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi everyone,
I now arrive at the Client GUI level, thank God it's friday;.)
But I have now some troubles to get my way through it.
So here some questions:
1.
Because I use the fat-client approach due to the convincing discussion in a prior thread, my Client side will have to implement the user-friendly methods book and find. I have one Adapter - Class, called RoomAdapter, which are defining the methods book and find. Further I have one Controller-Class, which main raison d'�tre consists in:
I. to transform the return value of the find- method of the RoomAdapter-Class - a List - in a RoomTableModel instance, and thus to enable the MVC-Pattern.
II. to catch the Data- and Network-Layer specific exceptions and to wrap them in a client-friendly exception like GUIException
Here my questions:
a) Do you think the methods book and find are enough, or do I need more methods like perhaps unbook()?
b) in the RoomAdapter-class I have hardcoded the number of data-fields, and the indexes for certain fields like owner and date-field.
I mean, I use constants for them, because I haven't implemented a function through which the client can get these Meta-Data informations from the Data-Layer. Do you think that's ok, or do you recommend to implement a function like getMetaData() for the client?
In this case, it would be a little bit annoying because the Data-Layer can be accessed only through the DBAccess-interface.
c)in the RoomAdapter-class, I have a method called validateDate() which takes in consideration the 48h -criterion. This criterion will also be hardcoded as a long constant containing the value in millisecond. The actual date will be transformed in a long value containing the millisecond-value (of course, without taking in consideration the actual time, only the actual date.). But before I continue to confuse everybody , I will post here some code-snippet:

It would be interesting to know how you guys handle the 48h-criterion, have you also hardcoded it or perhaps have you stored them in the properties-file?
2.
In the Controller-Class I have only one find-method, which will be called from the View-Class in four different manners:

After reading some threads here, I think most of you guys use ComboBox for the search of data.
So there would be two uneditable Comboboxes with all hotel- and location-values.Further in each Combobox there will also be an value "all", so all combination above will be possible. Sounds that reasonnable?

Thanks a lot in advance for your help
Ulrich
[ December 05, 2003: Message edited by: Ulrich Heeger ]
[ December 05, 2003: Message edited by: Ulrich Heeger ]
 
Ulrich Heeger
Ranch Hand
Posts: 266
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have now splited my questions in two different threads hoping thus that nobody isn't afraid of my questions anymore
regards
Ulrich
 
Ranch Hand
Posts: 555
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ulrich,
1.

Do you think the methods book and find are enough, or do I need more methods like perhaps unbook()?


I am sure that no unbook() is needed. Having book/find is enough.


in the RoomAdapter-class I have hardcoded the number of data-fields, and the indexes for certain fields like owner and date-field... Do you think that's ok, or do you recommend to implement a function like getMetaData() for the client?


I personally beleive that getMetaData() is a MUST. Actually it s not so hard to implement it, since the most information is anyway needed on the server, so there is no much word for the Data class to provide this method.
My advice: make the MetaData object immutable.

in the RoomAdapter-class, I have a method called validateDate() which takes in consideration the 48h -


I do insist, there is no reason to implement it. Just document it.
I know, I lost 7 points for my GUI, but I am more then sure, it was not a reason.

So there would be two uneditable Comboboxes with all hotel- and location-values.Further in each Combobox there will also be an value "all", so all combination above will be possible. Sounds that reasonnable?


Sounds reasonable. I, personally, had JTextFields. An empty field ment the same as "All" option in your ComboBox scenario. I feel like both solutions (meines and yours) are good and valid.
Phil will disagree with my first answers. In any case, I insist, no unbook() is needed.

Best,
Vlad
 
Bartender
Posts: 1872
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ulrich,
Mmh..., "main raison d'�tre", ... a nice trick to get answers from people who don't currently have time to make them !
1.a : book() and find() are enough IMO. I wouldn't implement any unbook() method. This is not in the instructions, meaning that if you implement it, you'll not gain any point with it anyway. Worst, an unbook() method may go against the business rules of the customer. I thought of an "Undo" method which is more defendable IMO (standard in any Edit menu, scoped to the bookings performed by the user, any allowing no booking confirmation popup (better user experience)).
1.b : As you use constants, it's OK IMO. There is no more chance a field index will be changed than a field name will be changed. And your field access is faster.
1.c : I have no experience yet in playing with dates in Java. But at first sight, your code looks complex. Just a comment on the way you named your variables : I know that in French the English word "actual" if a fake friend : "actual" means "real" in English while "actuel" means "current" in French. As you speak French as well as German, maybe you got influenced by that. So I'd rename "actualTime" in "currentTime".

It would be interesting to know how you guys handle the 48h-criterion, have you also hardcoded it or perhaps have you stored them in the properties-file?


IMO, you must handle it as properties. Think of the fact that if you don't, your examiner will have no visible data to test your application. I think that the best form of that 48h-criterium in properties is a time range with optional past and future limits.
2. I confirm for the comboboxes. I'll just add that "any" is more appropriate than "all" IMO, and that I'll use the "[ANY]" value to make clear to the user that it's a special value.
Just one comment about your find() method signature : as the GUI instructions state that :

Your user interface should be designed with the expectation of future functionality enhancements, and it should establish a framework that will support this with minimal disruption to the users when this occurs.


I'd abstract the search criteria at the GUI level.
Best,
Phil.
 
Philippe Maquet
Bartender
Posts: 1872
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Vlad,

Phil will disagree with my first answers. In any case, I insist, no unbook() is needed.



I wrote my reply to Ulrich before reading yours ! Anyway we agree on the fact that unbook() is not needed.


Ulrich:
in the RoomAdapter-class, I have a method called validateDate() which takes in consideration the 48h -
Vlad:
I do insist, there is no reason to implement it. Just document it.
I know, I lost 7 points for my GUI, but I am more then sure, it was not a reason.


I think you didn't loose any point in the GUI because you didn't take the 48h criteria into account. It's just a guess, but I think of the lack of comboboxes to help the user search.
But even if you passed with a good score without taking the 48h criteria into account, I wouldn't bet that it would be the case for all of us. I insist : that bookable time range is in the instructions ! It is not a "must" instruction though, but as examiners are numerous, you may have one who doesn't pay any attention to it, while another would take it into account. "General Considerations" is the section where you could loose points for it IMO.
As far as getMetaData() is concerned, I have one so I may agree with you . But my design is quite different as I use a 3-tiers design. As the 2-tiers one is slower (by nature and given the DBAccess method signatures we received), does it worth while to make the client use it (given my comments in the previous post) ?
Best,
Phil.
[ December 05, 2003: Message edited by: Philippe Maquet ]
 
Ranch Hand
Posts: 240
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My adapter has:
1.book
2.find
3.getDatebaseInfo
4.close(for local client to close the database, for remote client to do nothing)
Best
 
Ulrich Heeger
Ranch Hand
Posts: 266
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Vlad, hi Phil,
thank you for your help.
Vlad, I'm glad to hear you've passed the exam, I don't know how far are you Phil, I remember you prepare yourself for another exam?
Anyway, it's really cool that you still take the time to help others.
Vlad wrote:


I personally beleive that getMetaData() is a MUST. Actually it s not so hard to implement it, since the most information is anyway needed on the server, so there is no much word for the Data class to provide this method My advice: make the MetaData object immutable.


Like Phil remarked, I have the 2-tier solution but I remember you too.
(So this is not an argument for to avoid the harder way
So here my questions:
1.In fact, I have on the server a method createDataSchemaInstance, which is called when the server starts and thus instantiates my singleton of DataSchema. So I could have also a call to get the MetaData object and to registred it, so I can make a remote call to get it. That sounds reasonnable? (please say yes and I will press my thumbs for Latvia next year in their match against Germany
2.Concerning the informations needed at the server-side and the client side:
a) at the server side I need only the validation of the db-file with the MagicCookie.
b) at the client side I need the fieldNames, the Number of fields in a Record and perhaps the position (index) of each field in the Record.
Is that ok, have I missed something or IYO do I provide a redundant information?
Phil wrote:


Just a comment on the way you named your variables : I know that in French the English word "actual" if a fake friend : "actual" means "real" in English while "actuel" means "current" in French. As you speak French as well as German, maybe you got influenced by that. So I'd rename "actualTime" in "currentTime".


Thanks to have pointed me to this, that's true sometimes I only translate the french in an apparently equivalent english and oops!


I'd abstract the search criteria at the GUI level.


Do you mean you keep find(null,null,null,null,null,null,null) adapted to the original argument range of the findByCriteria-method?
Thanks you guys
Ulrich
[ December 05, 2003: Message edited by: Ulrich Heeger ]
 
Ulrich Heeger
Ranch Hand
Posts: 266
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Damu,
thank you for your advice.
Why do you provide a close-method? To ensure the client quits only before a book-method has really been completed?
Greetings
Ulrich
 
Vlad Rabkin
Ranch Hand
Posts: 555
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ulrich,

I have on the server a method createDataSchemaInstance, which is called when the server starts and thus instantiates my singleton of DataSchema. So I could have also a call to get the MetaData object and to registred it, so I can make a remote call to get it. That sounds reasonnable?


YES.

at the client side I need the fieldNames, the Number of fields in a Record and perhaps the position (index) of each field in the Record.


Correct.
Best,
Vlad
P.S. I don't think Latvia has any chances to win Germany. They are already heroes, because they managed to win Turkey. Moreover, since I live in Germany, I will be happy with any results, as long as Germany (I know Germany player better than Latvians) or Latvia gets to play-offs.
 
Vlad Rabkin
Ranch Hand
Posts: 555
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Phil,

... I may agree with you ... But



I knew it!
Best,
Vlad
 
Ulrich Heeger
Ranch Hand
Posts: 266
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Vlad,
thank you


I don't think Latvia has any chances to win Germany. They are already heroes, because they managed to win Turkey.


That was a great game, 2-2, I couldn't believe it
Ulrich
 
reply
    Bookmark Topic Watch Topic
  • New Topic