Help coderanch get a
new server
by contributing to the fundraiser
  • 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
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

A sample exam question

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Could anyone explain what the correct answer the question mentioned below?? I thought the answer was c.
Refer to the Figure http://certify.torolab.ibm.com/figures/test486F9.gif.
Consider the scenario that eStore.com sells small appliances over the Internet. Currently, the store's catalog includes over 50 appliances from 10 different suppliers. A partial class diagram is shown in Figure Sample 1. If there is a new requirement to restock the warehouse automatically as products are sold, how is the new requirement BEST handled?
a)

Add "reorderLevel" and "reorderQuantity" attributes used by a new
deplete() method in the Inventory class. Use these to generate new orders as InventoryProducts are sold.

b)

Add "reorderLevel" and "reorderQuantity" attributes used by a new
deplete() method in the InventoryProduct class. Use these to generate new orders as InventoryProducts are sold.

c)

Add a deliver() method to the Supplier class that uses the
InventoryProduct's amountOnHand attribute to maintain the
InventoryProducts in the warehouse.
d)

Add "reorderLevel" and "reorderQuantity" to InventoryProduct.
Create a Warehouse class that monitors the InventoryProducts'
"amountOnHand", generating an order as levels drop below a
"reorderQuantity".

Thanks
Madhu
 
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My answer d.
d allows different InventoryProduct has different reorderLevel and reorderQuantity. Having a Warehouse class will help so that InventoryProduct doesn't have too many responsibilities.
But I am not so sure. B or D? Any help is appreciated!
[This message has been edited by Caroline Iux (edited May 20, 2001).]
 
Ranch Hand
Posts: 704
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My answer was also D. For the same reasoning as Caroline's. An InventryProduct should not have the responsibilty of odering itself.
 
Ranch Hand
Posts: 1157
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I would lean towards A.
Note that creating a "Warehouse" class and monitoring the "amountOnHand" would lead to a similar relationship as "Inventory" and "InventoryProduct".
The diagram shows that "Inventory contains InventoryProduct".Had there been a "Warehouse" class we would have had "Warehouse contains InventoryProduct" - Thus "Warehouse" class looks redundant to me, since "Inventory" is quite capable to monitor the "InventoryProduct".
Also, since "Inventory" contains "InventoryProduct", the responsibilty to reorder an "InventoryProduct" should be with the "Inventory" rather than the "InventoryProduct".The deplete() method in the "Inventory" class can check the "InventoryProduct.amountInHand" attribute by using "InventoryProduct.inStock()" method.If necessary, it can set the reorder attributes and create the Order instance.
I believe the "reorder level" and "reorder quantity" would probably be decided by the Inventory;they may be implemented as final static variables in Java.For example, it might be if the "amountOnHand" for "InventoryProduct" falls below 100, the Order instance would be created for the InventoryProduct with reorderLevel = A and reorderQuantity=10.The Order instance would be capable to interpret the reorder values.
Please let me know your views on this.
Thanks in advance,
Sandeep
[This message has been edited by Desai Sandeep (edited May 21, 2001).]
 
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have been following this discussion with a lot of interest as I am trying to get to grips with OOAD.
I think Sandeep has raised a valid point,however I fail to understand how the option A will cater to the fact that different inventory products could have different reorder levels and reorder amounts governed by the demand and supply rules. As I understand that option A requires Inventory to maintain reorder levels and reorder quantity.
I feel it depends on the requirements. Option A if all the inventory products are governed by a single reorder level and reorder amt else option D
 
Desai Sandeep
Ranch Hand
Posts: 1157
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Lancy,
If I am correct, there are different reorder levels (A,B,C and D) and reorder quantities at Inventory Level.All the "InventoryProducts" could be categorized in these levels/quantities.The inventory (or warehouse) decides when to reorder a particular product.The decision to reorder would be influenced by various reasons - one of them being the "InventoryProduct.amountOnHand".Other reasons could be storage space, seasonal change etc.
In that case, the "InventoryProduct.amountOnHand" will only inform the Inventory on quantity "inStock()".Then the Inventory based on other influential factors will decide when to reorder the product.
"Inventory" knows about the environment (is the best judge) of "InventoryProduct".For example,

  1. When (which month?) the demand for the "InventoryProduct" is likely,
  2. Will the "InventoryProduct" endure the seasonal change, or,
  3. Is there enough storage space for the InventoryProduct
  4. ...

  5. Based on above these criteria, "Inventory" would decide when to reorder of "InventoryProduct".Hence the single reorder attributes should be in the "Inventory" class.
    Hope this helps,
    Sandeep

    Hence,I believe these attributes should be of "Inventory" rather than "InventoryProduct".
    Hope this helps,
    Sandeep


 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My answer is A. Because InventoryProduct knowns if a product is inStock(). The Supplier is known to the same object
Inventory Object should be get teh task done .

Originally posted by Madhusudan Karody:
Could anyone explain what the correct answer the question mentioned below?? I thought the answer was c.
Refer to the Figure http://certify.torolab.ibm.com/figures/test486F9.gif.
Consider the scenario that eStore.com sells small appliances over the Internet. Currently, the store's catalog includes over 50 appliances from 10 different suppliers. A partial class diagram is shown in Figure Sample 1. If there is a new requirement to restock the warehouse automatically as products are sold, how is the new requirement BEST handled?
a)

Add "reorderLevel" and "reorderQuantity" attributes used by a new
deplete() method in the Inventory class. Use these to generate new orders as InventoryProducts are sold.

b)

Add "reorderLevel" and "reorderQuantity" attributes used by a new
deplete() method in the InventoryProduct class. Use these to generate new orders as InventoryProducts are sold.

c)

Add a deliver() method to the Supplier class that uses the
InventoryProduct's amountOnHand attribute to maintain the
InventoryProducts in the warehouse.
d)

Add "reorderLevel" and "reorderQuantity" to InventoryProduct.
Create a Warehouse class that monitors the InventoryProducts'
"amountOnHand", generating an order as levels drop below a
"reorderQuantity".

Thanks
Madhu


 
Desai Sandeep
Ranch Hand
Posts: 1157
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Senthil,
I am also with A.But I think you have reasons other than what I have stated.Do you agree/disagree with my reasoning?Could you elaborate on what are your views?
Thanks in advance,
Sandeep
[This message has been edited by Desai Sandeep (edited May 22, 2001).]
 
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Desai Sandeep:
Senthil,
I am also with A.But I think you have reasons other than what I have stated.Do you agree/disagree with my reasoning?Could you elaborate on what are your views?
Thanks in advance,
Sandeep
[This message has been edited by Desai Sandeep (edited May 22, 2001).]



I think your suggestion works too. Perhaps is a lot more flexible than what the original question were asking. It's simply asking for "...to restock the warehouse automatically as products are sold..." Basically, when stocks run low, then get the stock. Not so much on seasonal or running out of space
By the way, you don't agree on D ...is it because it's too hassle to refactor or you reckon it does NOT work?
 
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am wondering why hasn't anyone opted for B? Wouldn't that be the easiest solution? I am still not convinced why B is not the answer. I see analogies with:
1. the Observer pattern. InventoryProduct acts as the publisher of the event that an order's stock has gone below reorderLevel and notifies the appropriate class with responsibility to reorder.
2. the data model (even though Fowler and all do not recommend matching class models with data models)! In a RDBMS, wouldn't we have a trigger with the InventoryProduct table to keep track of the stock and reordering logic?
Giving the responsibility to check available to any other class seems too much strain. How often would that class check the available stock of InventoryProduct?
Anyone with a 100% score on the samples?
Thanks
Sanjeev
 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You are right Sanjeev. My answer to this question in one of my mock exam trials was also B and I scored a 100% at that time.
I agree with your reasoning that InventoryProduct is the "publisher of the event".

 
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Wow!
I got 100% for the section with this question, and I answered C.
I am starting to wonder about the validation of answers on IBM's pretest.
 
Salvador Villavieja
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Johanna,
The questions on the IBM sample exams are not ordered according to the test objectives. The distribution of the questions according to the objectives IS correct, but I do not think the questions are ORDERED according to the objectives as they are listed in your exam results.
Salvador
[This message has been edited by Salvador Villavieja (edited August 27, 2001).]
[This message has been edited by Salvador Villavieja (edited August 27, 2001).]
 
Desai Sandeep
Ranch Hand
Posts: 1157
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
The correct answer to this question is B.I have scored 100% in the pre-assessment test.Please go through this post for the correct answer and explanations for this question as well as others.
Hope this helps,
Sandeep
SCJP2, OCSD(Oracle JDeveloper), OCED(Oracle Internet Platform)
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic