Passing object from Web tier to Ejb tier
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
I have certain business service interfaces (pricing strategies etc) which would act upon these objects and I find it a little odd that the interface method would have a VO as its method signature instead of a domain object.
Parag
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
since the web tier shouldn't know too much about the internals of the ejb tier and there're several patterns to achieve that (e.g., BD, Facade) my guess would be VO using an update strategy if that's necessary.
HTH,
Harbo
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Originally posted by H. Hafer:
Parag,
since the web tier shouldn't know too much about the internals of the ejb tier and there're several patterns to achieve that (e.g., BD, Facade) my guess would be VO using an update strategy if that's necessary.
HTH,
Harbo
Harbo,
Yeah, the VO update strategy works where updates are needed to be sent across to the ejb tier. Thats not a problem.
My problem can be best illustrated with an example : I have a service interface which prices a Product and I want to pass the Product which it should price,my problem is that the Product is passed as a ProductVO from tier to tier and as a result of which, my interface method is now getPrice(ProductVO) instead of getPrice(Product), which doesnt look nice as anyone requiring that service would have to create a ProductVO first and then access this service, which seems rather restricting.
what is the way out of this VO-ness?
Parag
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
probably I didn't fully understand your example, but I can't imagine anyone to use getPrice(Product) outside the business logic. The clients shouldn't be aware of these internals. On the other hand, the business logic designer had a good reason to implement ProductVOs, because VOs are, well, valuable :-)
So there's no point in using getPrice(Product) on the business tier either.
As a side note, I sincerely hope that details of this depth are not required for the assignment -- else we'll witness the falling of Hafer someday ;-)
HTH,
Harbo
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Originally posted by H. Hafer:
Parag,
probably I didn't fully understand your example, but I can't imagine anyone to use getPrice(Product) outside the business logic. The clients shouldn't be aware of these internals. On the other hand, the business logic designer had a good reason to implement ProductVOs, because VOs are, well, valuable :-)
So there's no point in using getPrice(Product) on the business tier either.
As a side note, I sincerely hope that details of this depth are not required for the assignment -- else we'll witness the falling of Hafer someday ;-)
HTH,
Harbo
Harbo,
I have a scenario where a stateless session bean calculates price. It looked odd that the business method would take a VO as a parameter instead of a domain model object. Maybe, it seems odd to me..but is it alrite to have a VO passed as a parameter to a stateless session bean method? All this is executing in the business tier. The stateless session bean could be called by a session facade.
Parag
| Being a smart alec beats the alternative. This tiny ad knows what I'm talking about: Paul Wheaton's 16th Kickstarter: Gardening playing cards for gardeners and homesteaders https://coderanch.com/t/889615/Paul-Wheaton-Kickstarter-Gardening-playing |






