Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes HFE Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "HFE "Brain Power" on p. 269" Watch "HFE "Brain Power" on p. 269" New topic
Author

HFE "Brain Power" on p. 269

Karin Paola Illuminate
Ranch Hand

Joined: Oct 18, 2002
Posts: 109
What is the correct answer?

I've got

1 make a new customer
2 change an existing customer's phone number
3 find all the customers in pleasantville
4 delete all customers previously declared 'inactive'
5 delete a specific customer
6 get the street address of a specific customer

home: 1, 3, 4
component: 2, 5, 6


I not only use all the brains that I have, but all that I can borrow. [Laurence J. Peter]
Nathaniel Stoddard
Ranch Hand

Joined: May 29, 2003
Posts: 1258
I forgot to memorize page 269 -- what was the question?


Nathaniel Stodard<br />SCJP, SCJD, SCWCD, SCBCD, SCDJWS, ICAD, ICSD, ICED
Karin Paola Illuminate
Ranch Hand

Joined: Oct 18, 2002
Posts: 109
The question is as follows :
Think about the following operations, and figure out which of the two client interfaces (component or home), is better suited for each operation.

1 make a new customer
2 change an existing customer's phone number
3 find all the customers in pleasantville
4 delete all customers previously declared 'inactive'
5 delete a specific customer
6 get the street address of a specific customer

[ September 28, 2004: Message edited by: Karin Paola Illuminate ]
Clovis Hartig II
Greenhorn

Joined: Sep 11, 2004
Posts: 20
Hi,

What's HFE?
Karin Paola Illuminate
Ranch Hand

Joined: Oct 18, 2002
Posts: 109
I mean the book Head First EJB (HEF).



Think about the following operations, and figure out which of the two client interfaces (component or home), is better suited for each operation.

1 make a new customer
2 change an existing customer's phone number
3 find all the customers in pleasantville
4 delete all customers previously declared 'inactive'
5 delete a specific customer
6 get the street address of a specific customer


I was thinking about :

Operations 1, 3 and 4 for home interface, and operations 2, 5 and 6 for component interface.
Clovis Hartig II
Greenhorn

Joined: Sep 11, 2004
Posts: 20
Hi,

What does HFE part of Subject line refer to? I know of HFJ, HFEJB, HFS&JSP, and upcoming HFDP.

What's HFE?

Thanks.
Nileesha Bojjawar
Ranch Hand

Joined: Oct 10, 2003
Posts: 85
Hi,

I would say that 1 and 3 as Home interface and the rest in remote.
Because you can define the methods to delete based on a criteria as a business method.
Corect me if i am wrong

Thanks


Nileesha<br />SCJP 1.4, SCBCD, SCWCD.
Clovis Hartig II
Greenhorn

Joined: Sep 11, 2004
Posts: 20
Oh, ok. I see Karin answered that HEF means HF EJB. Possibly the acronym is diff in another language (if the books are so far published in non-English editions). Thanks for the clarification.
Susanta Chatterjee
Ranch Hand

Joined: Aug 12, 2002
Posts: 102
Option 5 is appropriate for Home too, as you can use remove(handle) method of EJBHome to remove a entity bean.
shanthisri mocherla
Ranch Hand

Joined: Sep 05, 2005
Posts: 119
Hi friends,
I think
change an existing customer's phone number operation is suited both for home and component interface as we can use find method of home to get an existing customer and then update it.
Is it correct?

Delete all customers in Plesantville operation is suited for home interface only.I guess as component interface methods are only used for single entity operations not batch operations .Is it correct?

One more question is
Can we delete multiple entities by using remove(Handle h) or remove(Object key) methods of home interface??
I guess we CANT.
Thanks in advance
shanthisri
Frederic Esnault
Ranch Hand

Joined: Feb 13, 2006
Posts: 284
About the delete all customers declared inactive, you can use the home business methods or the find methods to get a Collection of primary keys then use the remove(key) on each of them.

About the 5 (delete a specific customer), it may suit to home & component. If your in the customer to be deleted, then it's the component interface, by calling remove() (no args). But you can still do it from the home interface if you know the specific customer's primary key. So it fits to both interfaces.


SCJP 5 - SCWCD 1.4 - SCBCD 1.3 - Certification study documents/resources: http://esnault.frederic.free.fr/certification
Ankit Doshi
Ranch Hand

Joined: Dec 04, 2002
Posts: 222
From exam point of view, this question looks quite confusing. Confusing because, there are multiple possibilities here...

If we go for the best option, then "one entity specific methods are in component interface and methods dealing with multiple entities, are better suited in home interface".

But if we go by all possible options, then other options like above can also be considered.

What should be a correct reply from the actual exam point of view?
Frederic Esnault
Ranch Hand

Joined: Feb 13, 2006
Posts: 284
My answer would be :
home : 1,3,4,5
comp. : 2,6

I put the 5 into home because, in my opinion, "delete a specific customer" means use a primary key to delete a customer. If it said "delete
Frederic Esnault
Ranch Hand

Joined: Feb 13, 2006
Posts: 284
My answer would be :
home : 1,3,4,5
comp. : 2,6

I put the 5 into home because, in my opinion, "delete a specific customer" means use a primary key (or maybe handle) to delete a customer. If it said "delete a customer", I would have selected the component interface.
Voila. What do you think?
John Anaivs
Ranch Hand

Joined: Apr 17, 2006
Posts: 73
I answered the same as Frederic and I used the diagram in the page 280 for that.
 
GeeCON Prague 2014
 
subject: HFE "Brain Power" on p. 269