aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes UrlyBird - the effect of 48 hours? please do not ignore my question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "UrlyBird - the effect of 48 hours? please do not ignore my question" Watch "UrlyBird - the effect of 48 hours? please do not ignore my question" New topic
Author

UrlyBird - the effect of 48 hours? please do not ignore my question

Mike Tilling
Ranch Hand

Joined: Feb 17, 2006
Posts: 86
Hi,

Could you please help me with that (English is my second foreign language)

It was mentionned in my assignement spec :
"They take bookings only within 48 hours of the start of room occupancy"

What is the effect of that in my booking procedure?
Can I ignore this statement?
B Chen
Ranch Hand

Joined: Dec 27, 2005
Posts: 89
Its a business rule that must be implemented.
Basically it means if the availability date of the room is today, tomorrow, or the day after tomorrow, the user can book the room. Otherwise the system should not allow the room to be booked.
[ March 23, 2006: Message edited by: B Chen ]

SCJD<br />SCJP 1.4
Jason Moors
Ranch Hand

Joined: Dec 04, 2001
Posts: 188
I think there are two ways you can handle this requirement.

1) Filter Records in the business layer (not in the DB layer), so that only rooms that are available within the next 48 hours are displayed in the GUI.

2) Display all records but if a user selects a room that is not available in the next 48 hours, display an error message.

I personally have gone for option 1 (filtered the list on date) as I don't believe it is user friendly to display a room which may be available in a months time.

Jason.
tom smith
Greenhorn

Joined: Feb 16, 2006
Posts: 20
jason,

is the business layer between the gui and the data class?

if so, i should send my searchEvent code to this layer who will filter the results returned by the data layer before sending my gui the long[] of acceptable records?

- the uber newbie

i am getting pretty close to finishing.

but i want to tweak the design.

then download and learn 'junit' for final stress testing.
[ March 25, 2006: Message edited by: tom smith ]
Jason Moors
Ranch Hand

Joined: Dec 04, 2001
Posts: 188
I guess it depends on your design... I decided to implemented a Business Layer as I think it's good practice to separate the business logic from the presentation layer (in our case a Swing GUI).

Imagine if the IT director came to you in a few months with a requirement to Web enable the application, if you have seperated out your logic it would be quite straightforward to create a Front Controller for the web application and then reuse all the existing logic.


if so, i should send my searchEvent code to this layer who will filter the results returned by the data layer before sending my gui the long[] of acceptable records?


Yes, your searchEvent method in the GUI controller class should call the business layer to retrieve matching records. I would recommend that your business layer doesn't just provide the long[] back to the GUI layer, but instead call the read method for each record and return this information back to the GUI.

The more you abstract the functionality from the different layers the more flexible your design will be.

Jason.
Robert Vilhelm
Greenhorn

Joined: Mar 27, 2006
Posts: 4
Hi,

Originally posted by Jason Moors:
I think there are two ways you can handle this requirement.

1) Filter Records in the business layer (not in the DB layer), so that only rooms that are available within the next 48 hours are displayed in the GUI.

2) Display all records but if a user selects a room that is not available in the next 48 hours, display an error message.
Jason.


(the english is my second foreign language too)
I would prefer another option based on the first one.
I would display all records matching user's search criteria, but the unavailable ones could be marked for instance with red color. The tray to book these records should invoke an error message. (The "booking button can bee disabled as well)
The reason: User can bee confused with an empty search result especially when he knows that such a record exists.

SCJP 1.4
SCJD - URLyBird in progress
Jason Moors
Ranch Hand

Joined: Dec 04, 2001
Posts: 188
If I understand correctly, I think you are recommending filtering the rooms based upon the 48 hour availability rule, but then displaying the booked rooms?

I personally think this would be more confusing for a user, displaying a large number of records, when they can actually only book a few. If you compared this to the real world, if you tried to search for a room for on Expedia for the 28th March, you wouldn't expect it to display hunderds of booked rooms, only the ones that are available.

I guess you could argue that the system is for agents not end customers and therefore they may want to unbooked rooms etc, but I think this is outside of the requirements.

Jason
[ March 28, 2006: Message edited by: Jason Moors ]
Robert Vilhelm
Greenhorn

Joined: Mar 27, 2006
Posts: 4
Hi,
Originally posted by Jason Moors:

I guess you could argue that the system is for agents not end customers and therefore they may want to unbooked rooms etc, but I think this is outside of the requirements.

Jason

[ March 28, 2006: Message edited by: Jason Moors ]


Background says:
URLyBird wants to move into Internet-based marketing, and hopes to be able to accept bookings direct from customers over the web.

I thing this is the point,
thank you.
Robert
PS: I looked over this sentence (It is spoken about CSRs a few sentences above).
Ken Boyd
Ranch Hand

Joined: Dec 10, 2003
Posts: 329
In my design you will see all records according to search criteria. If you just filter records according to 48 hours and ignore search criteria you might loose points (correct me if I am wrong)

Now display all records according to search criteria but display error message (dialogue window) when user select record, which fall under 48 hours rule.


SCJP, SCWCD, SCBCD, SCJD, BB Java2 and JSP1.1
Jason Moors
Ranch Hand

Joined: Dec 04, 2001
Posts: 188
Hi Ken,

I implemented the int[] find(String[] criteria) method in tha Data class to return all records that match the criteria. However in my business layer I filter on date and records that have booked.

I guess it depends on how you interpret the requirements.
They take bookings only within 48 hours of the start of room occupancy

The GUI does not support searching by date, so I have decided to filter based upon the 48 hour requirement as there could be records in the database for rooms that were available 3 months ago, and I don't think it makes sense to display these rooms.

I'm not saying my approach is right, but personally think having hundreds of records that are not available is not very user friendly, i.e date of availability in the past or in the future, or already booked.

I'm sure you approach is also valid, it's just that I think it will not be clear to the user which rooms are available or not.

As long as you can justify the reason for your decision I'm sure you will not lose marks.

Jason.

[ March 31, 2006: Message edited by: Jason Moors ]
[ March 31, 2006: Message edited by: Jason Moors ]
Jason Moors
Ranch Hand

Joined: Dec 04, 2001
Posts: 188
I found this post which seems to imply that people have taken both approaches.

48 Hours Rule and Search
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: UrlyBird - the effect of 48 hours? please do not ignore my question