File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Does GUI need to provide only find and book functionality? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Does GUI need to provide only find and book functionality?" Watch "Does GUI need to provide only find and book functionality?" New topic
Author

Does GUI need to provide only find and book functionality?

Pieter Jacobs
Ranch Hand

Joined: May 20, 2009
Posts: 87
Hi guys,

I keep on reading through my 'instructions' (from Sun) - every now and again, to make sure I don't miss something or don't do something I have to etc.

Now I've read something that I would like to bounce off you all:

I have the 'Bodgitt & Scarper' project, where I have to provide the Booking and Unbooking/Releasing of Subcontractors.

Close to the start of the instructions it says:

.. The company's IT department has a data file that contains the essential information for the company, but because the data must continue to be manipulated for reports using another custom-written application, the new system must re-implement the database code from scratch without altering the data file format.
The new application, using the existing data file format, must allow the CSRs to generate a list of contractors that match a customer's criteria
. This is the project that you have been commissioned to implement.


Later it says:

... "Data.java", ..., and must implement the following interface:
... public interface DB ...


According to the first block above, (the part I've highlighted); I understand it as such, that the GUI should only provide the functionality for searching for records, and not updating existing records, inserting new records, deleting records. Even though I understand it as such, the second block (above) says that I must implement the DB interface.
Does this mean that even though I have to implement to interface, I will not have to actually use the insert, update, delete, etc. etc. methods?

So far I've done quite a bit concerning inserting new Subcontractors, updating existing ones, removing ones, etc.

Ps: Do I understand the above correctly, or am I falling off track now?

Thanks buds,
Pieter

[edit] changed to more meaningful title
Carlos Morillo
Ranch Hand

Joined: Jun 06, 2009
Posts: 221

Hi Pieter,


Yes, you are correct.
Your Data class MUST implement ALL the methods in the Sun provided interface.

However, your GUI in order to implement the functionality required will need to use a subset
of the methods implemented by the Data class.
For instance, I have URLyBird 1.1.3 and my GUI only needs to provide the functionality to
Book a Room and to Search Hotel Rooms with a certain Hotel Name and/or Location as criteria.

My Book method will call the Data class API like this:



Search Hotel Rooms will also need to call a method or method(s) from my Data class API.

My create() and delete() methods they are 100% implemented by my Data class,
however they are not being used by any client code.
Well I created some test classes besides using Roberto Perillo's DataTestClass to test all the
methods in my Data class including the locking of my Data class. Check the SCJD FAQ.


Hope this helps,


Carlos.


SCSA, OCA, SCJP 5.0, SCJD http://www.linkedin.com/in/carlosamorillo
Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 5147
    
  12

A really funny question in this discussion could be: is an empty implementation a valid implementation? So will someone with code like the following pass:

You could explain in your choices.txt that you implemented only the methods you needed (and which are referenced from gui or business service), so you could release this version of the application as soon as possible. CSRs could use the new application a whole lot faster (because no implementation/testing is needed for methods which are not used at all) and when the GUI is extended with "creation of new rooms"-functionality the business service should be extended and the create-method gets its actual implementation.

Kind regards,
Roel


SCJA, SCJP (1.4 | 5.0 | 6.0), SCJD
http://www.javaroe.be/
Roberto Perillo
Bartender

Joined: Dec 28, 2007
Posts: 2258
    
    3

Roel De Nijs wrote:A really funny question in this discussion could be: is an empty implementation a valid implementation?


I guess this is something that we'll never know for sure... unless someone that hasn't submitted yet wants to pay to see that!


Cheers, Bob "John Lennon" Perillo
SCJP, SCWCD, SCJD, SCBCD - Daileon: A Tool for Enabling Domain Annotations
Pieter Jacobs
Ranch Hand

Joined: May 20, 2009
Posts: 87
Hi guys,

Carlos, thanks you gave me the answer I expected.

Roel, no you understood my question wrong (or I wasn't clear enough). My question wasn't about the interface but whether I understood the instructions correctly regarding the gui - whether only the find, booking & releasing functionality should be implemeted or everything (eg insert etc).

But I see I'm still on track.

Thanks guys,
Pieter
Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 5147
    
  12

Pieter Jacobs wrote:Roel, no you understood my question wrong (or I wasn't clear enough). My question wasn't about the interface but whether I understood the instructions correctly regarding the gui - whether only the find, booking & releasing functionality should be implemeted or everything (eg insert etc).

I indeed misunderstood and corrected the title of this topic (with a more meaningful title, like the current one, I couldn't misunderstand your question ). Nonetheless is the question I asked a really nice one
Carlos Morillo
Ranch Hand

Joined: Jun 06, 2009
Posts: 221

Hi Roel,


In my view his question was about implementing all the methods in the Sun interface regardless if they
are going to be used by the application or not.

I am starting to get confused by all the name changes to this thread.



Carlos.
Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 5147
    
  12

Carlos Morillo wrote:I am starting to get confused by all the name changes to this thread.


No more name changes expected for this thread
Pieter Jacobs
Ranch Hand

Joined: May 20, 2009
Posts: 87
Hi guys,

Cool, and thanks!

Enjoy the day,
Pieter
Walid Abd Elsalam
Greenhorn

Joined: Feb 26, 2010
Posts: 20
My understanding is that you're not supposed to change the format of the db file. Meaning record structure. However, your application should be free - and expected - to change the data in there.
You're not supposed to change the structure because the company has other applications using the same file. So, structure has to be maintained.


SCJP 6 85% - SCWCD 86%
Carlos Morillo
Ranch Hand

Joined: Jun 06, 2009
Posts: 221

Hi Walid,


Walid Abd Elsalam wrote:My understanding is that you're not supposed to change the format of the db file. Meaning record structure. However, your application should be free - and expected - to change the data in there.
You're not supposed to change the structure because the company has other applications using the same file. So, structure has to be maintained.



Now I am even more confused.



I haven't seen anybody in this thread asking about changes to the database file format.

I am sorry Walid, I think you posted to the wrong thread.


Carlos.
Roberto Perillo
Bartender

Joined: Dec 28, 2007
Posts: 2258
    
    3

Howdy, Walid!

However, your application should be free - and expected - to change the data in there.


Which is, the IDs of the clients being placed in each booked record when the records are updated. Is that what you mean? If so, yes, that's correct!
Walid Abd Elsalam
Greenhorn

Joined: Feb 26, 2010
Posts: 20
Roberto Perillo wrote:Howdy, Walid!

However, your application should be free - and expected - to change the data in there.


Which is, the IDs of the clients being placed in each booked record when the records are updated. Is that what you mean? If so, yes, that's correct!


This and being able to mark records deleted or updating the contents of each. That's what the interface dictates. The GUI part requirements is a bit fuzzy here, so my intention for the moment is to provide the ability for the user to execute all operations provided by the interface.

In reponse to the previous post, my point is that the requirements are clear that what should not change is the structure of the file. The data for each record is expected to change as user interacts with DB of course (updates/marking for deletion ..etc).

Of course you guys who have done the assignment before can correct me on this.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Does GUI need to provide only find and book functionality?
 
Similar Threads
Have some questions, please help
Questions about limited functionality
NX:Adding to given interface
NX: Client business requiements vs given interface
Miscellaneous Questions