You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Navjot Singh <na...@net4india.net> on 2004/06/05 17:47:31 UTC

[OT] EJB/Struts Design Question

Hi,

I have a typical case of Category and Product entity bean established in 1:N
relationship.

In the client tier, I wish to display the list of products along with their
category names.

1. Struts Action make a call to ProductDelegate.
2. ProductDelgate to ProductManager (SessionBean).
3. ProductManager to ProductHome (to get entity refs of Product Entities)

__My kind of solution__

1. I retreive collection of Product at ProductManager. All the product
instances will have category as CMR.
2. In session bean, i will iterate over the collection of products.
3. For each product, i create a new ProductCategoryVO which will contain
values from product and category entities.
4. Then return the collection of ProductCategoryVO to my action class.
5. Action class wll further pass on to JSP.

To me, it sounds like heavy work. What's the best way to handle this?
Any help/pointers are appreciated.

---------------
regards
Navjot Singh
Net4India Ltd.

If there's only one answer, then this must not be a very interesting topic.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Anyone can help? How do I know the URL of next page in javascript before leavening current page?

Posted by Sun Peng <ca...@fernridge.com>.
Hi,

If I choose one address from address bar, how can know that URL in
programming (like JavaScript) before the pages is forwarded?

Can anyone help?

Regards

Sun peng



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: [OT] EJB/Struts Design Question

Posted by Navjot Singh <na...@net4india.net>.
Hi,

>
>Hi Navjot
>
>I am late at answering this but still I thought I should.
>I agree with the design you have provided, but I wonder why
>are you using the ProductDelegate here.
>
>Is your application too big, or do you have too many type of clients ?

Judge by this - I have more than 100 intermingled entity beans.
and i have 2 type of clients.

>Are you using some caching mechanism in business delegate ?
NO.

>Are you using service locator pattern also ?
YES. and caching of homes happen here.

>
>Harjot

Navjot

>----- Original Message -----
>From: "Navjot Singh" <na...@net4india.net>
>To: "Struts Users Mailing List" <st...@jakarta.apache.org>
>Sent: Saturday, June 05, 2004 9:17 PM
>Subject: [OT] EJB/Struts Design Question
>
>
>> Hi,
>>
>> I have a typical case of Category and Product entity bean established in
>1:N
>> relationship.
>>
>> In the client tier, I wish to display the list of products along with
>their
>> category names.
>>
>> 1. Struts Action make a call to ProductDelegate.
>> 2. ProductDelgate to ProductManager (SessionBean).
>> 3. ProductManager to ProductHome (to get entity refs of Product Entities)
>>
>> __My kind of solution__
>>
>> 1. I retreive collection of Product at ProductManager. All the product
>> instances will have category as CMR.
>> 2. In session bean, i will iterate over the collection of products.
>> 3. For each product, i create a new ProductCategoryVO which will contain
>> values from product and category entities.
>> 4. Then return the collection of ProductCategoryVO to my action class.
>> 5. Action class wll further pass on to JSP.
>>
>> To me, it sounds like heavy work. What's the best way to handle this?
>> Any help/pointers are appreciated.
>>
>> ---------------
>> regards
>> Navjot Singh
>> Net4India Ltd.
>>
>> If there's only one answer, then this must not be a very interesting
>topic.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>For additional commands, e-mail: user-help@struts.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [OT] EJB/Struts Design Question

Posted by Harjot Narula <ha...@induslogic.com>.
Hi Navjot

I am late at answering this but still I thought I should.
I agree with the design you have provided, but I wonder why
are you using the ProductDelegate here.

Is your application too big, or do you have too many type of clients ?
Are you using some caching mechanism in business delegate ?
Are you using service locator pattern also ?

Harjot
----- Original Message ----- 
From: "Navjot Singh" <na...@net4india.net>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Saturday, June 05, 2004 9:17 PM
Subject: [OT] EJB/Struts Design Question


> Hi,
>
> I have a typical case of Category and Product entity bean established in
1:N
> relationship.
>
> In the client tier, I wish to display the list of products along with
their
> category names.
>
> 1. Struts Action make a call to ProductDelegate.
> 2. ProductDelgate to ProductManager (SessionBean).
> 3. ProductManager to ProductHome (to get entity refs of Product Entities)
>
> __My kind of solution__
>
> 1. I retreive collection of Product at ProductManager. All the product
> instances will have category as CMR.
> 2. In session bean, i will iterate over the collection of products.
> 3. For each product, i create a new ProductCategoryVO which will contain
> values from product and category entities.
> 4. Then return the collection of ProductCategoryVO to my action class.
> 5. Action class wll further pass on to JSP.
>
> To me, it sounds like heavy work. What's the best way to handle this?
> Any help/pointers are appreciated.
>
> ---------------
> regards
> Navjot Singh
> Net4India Ltd.
>
> If there's only one answer, then this must not be a very interesting
topic.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: [OT] EJB/Struts Design Question

Posted by Robert Taylor <rt...@mulework.com>.
Navjot, 

This sounds like a good design and follows suggested best practices.

>From a pure architectural perspective, I think your existing solution is best.
However if you are concerned with performance, then you may want to look into
the FastLaneReader pattern.

http://java.sun.com/blueprints/patterns/FastLaneReader.html

My .02.

robert

> -----Original Message-----
> From: Navjot Singh [mailto:navjot.s@net4india.net]
> Sent: Saturday, June 05, 2004 11:48 AM
> To: Struts Users Mailing List
> Subject: [OT] EJB/Struts Design Question
> 
> 
> Hi,
> 
> I have a typical case of Category and Product entity bean established in 1:N
> relationship.
> 
> In the client tier, I wish to display the list of products along with their
> category names.
> 
> 1. Struts Action make a call to ProductDelegate.
> 2. ProductDelgate to ProductManager (SessionBean).
> 3. ProductManager to ProductHome (to get entity refs of Product Entities)
> 
> __My kind of solution__
> 
> 1. I retreive collection of Product at ProductManager. All the product
> instances will have category as CMR.
> 2. In session bean, i will iterate over the collection of products.
> 3. For each product, i create a new ProductCategoryVO which will contain
> values from product and category entities.
> 4. Then return the collection of ProductCategoryVO to my action class.
> 5. Action class wll further pass on to JSP.
> 
> To me, it sounds like heavy work. What's the best way to handle this?
> Any help/pointers are appreciated.
> 
> ---------------
> regards
> Navjot Singh
> Net4India Ltd.
> 
> If there's only one answer, then this must not be a very interesting topic.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org