• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HFE "Brain Power" on p. 269

 
Karin Paola Illuminate
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Nathaniel Stoddard
Ranch Hand
Posts: 1258
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I forgot to memorize page 269 -- what was the question?
 
Karin Paola Illuminate
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

What's HFE?
 
Karin Paola Illuminate
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Clovis Hartig II
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 284
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ankit Doshi
Ranch Hand
Posts: 222
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 284
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 284
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I answered the same as Frederic and I used the diagram in the page 280 for that.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic