Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ejbCreate

 
ALaxmi Shankaran
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there any difference between passing the data/value object to the ejbCreate method and passing the list of all the
required fields as arguments e.g.

public ExampleKey ejbCreate (ExampleDataObject exampleDataObject)
AND
public ExampleKey ejbCreate (String exampleId,String exampleName,String exampleAddress)
 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you mean by difference ? Please explain.

I understand that in the first case the ExampleDataObject wraps exampleId, exampleName, exampleAddress. You can use any one of the approaches preferable the first one.
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually, I'd prefer the second one. The first one tends to tie your EJB's tightly to your Data Access Layer. See Floyd Marinescu's "EJB Patterns" for an explanation on why that's not a good idea.

Kyle
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic