• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Chapter 5 - HF Sark study group

 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For discussion of Head First EJB's Chapter 5.

Other Chapter discussions:
1 2 3 4
 
Subhash Bhushan C
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just so that we are clear with the concept of Entity/Bean/Instance difference:

 
Leena Diwan
Ranch Hand
Posts: 351
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sharpen pencil page 580

INSERT: create()
DELETE: remove()
UPDATE: setters called
SELECT: findby methods
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I agree with Leena's answers. I also wish to add that the findByPrimaryKey method is a capital 'B' and your other finder methods aren't restricted to begin with findBy (I think 'find' is required though) but it looks like good practice.
[ February 23, 2005: Message edited by: Marc Peabody ]
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Brain Power page 269
(Name the better suited interface to...)

Make a new customer - Home
Change an existing customer's phone number - Component
Find all customers in Pleasantville - Home
Delete all customers previously declared 'inactive' - Home
Delete a specific customer - Component
Get the street address of a specific customer - Component
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I found it helpful to review pages 98 & 99 for refreshing my mind with what is going on in the entity bean architecture and how it differs from session beans.

-----------------

Notice on 279, the second-from-last star bullet that home business methods can NOT throw RuntimeExceptions. From what I remember in the other Java tests I've taken, I'd expect to see a question that has a home business method throw UnsupportedOperationException, ClassCastException, or some other exception that isn't blatantly obvious at first glance as a RuntimeException.

Direct known subclasses of RuntimeException (from api javadoc):
ArithmeticException, ArrayStoreException, BufferOverflowException, BufferUnderflowException, CannotRedoException, CannotUndoException, ClassCastException, CMMException, ConcurrentModificationException, DOMException, EmptyStackException, IllegalArgumentException, IllegalMonitorStateException, IllegalPathStateException, IllegalStateException, ImagingOpException, IndexOutOfBoundsException, MissingResourceException, NegativeArraySizeException, NoSuchElementException, NullPointerException, ProfileDataException, ProviderException, RasterFormatException, SecurityException, SystemException, UndeclaredThrowableException, UnmodifiableSetException, UnsupportedOperationException
 
Deepa Korecherla
Ranch Hand
Posts: 197
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Marc Peabody:
Brain Power page 269
(Name the better suited interface to...)

Make a new customer - Home
Change an existing customer's phone number - Component
Find all customers in Pleasantville - Home
Delete all customers previously declared 'inactive' - Home
Delete a specific customer - Component
Get the street address of a specific customer - Component


I think the last one is Home int. Can anyone clarify
 
Deepa Korecherla
Ranch Hand
Posts: 197
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can anyone respond??
 
sawan parihar
Ranch Hand
Posts: 250
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
################################################
Get the street address of a specific customer
##############################################

The component interface is correct because we want address of a specific customer. May be in component interface you have getAddress() method that can be called.

Why you think thats home int is correct.

sawan
SCJP,SCWCD,SCBCD
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic