Title: [Xdoclet-user] is there anyway to include value-objects in strutsForm objects?

I have a bean named Customer that have a 1-1 relationship with Account.
Customer has 2 value objects named CustomerValue and AccountValue

I want to create CustomerForm that contains CustomerValue and AccountValue.

scenario #1: Attempt to generate all fields in struts-form object
----------------------------------------------------------------------------
/**
 * @struts.form
 *   include-all="true"
 *   include-pk="true"
 */
public class CustomerBean {..}

xDoclet generate the following file

public class CustomerForm
{  // Attributes with setter and getter
  ...
 
  // CMR local interface
  // It seems to me that this is wrong, since a Form object
  // is like a ValueObject. It shouldn't expose EJB stuff
  public AccountLocal account;
  public AccountLocal getAccount() {...}
  public void setAccount(AccountLocal act) {...}
}


scenario #2: attempts to generate only value objects
----------------------------------------------------------------------------
/**
 * @struts.form
 *   name="CustomerForm"
 */
public class CustomerBean
{
  /** @struts.form-field */ 
  public CustomerValue get/setCustomerValue();

  /** @struts.form-field */
  public AccountValue getSetAccountValue();
}


xDoclet generate the following file:

public class CustomerCustomerForm  <--------- look at the name???
{
  // And the class is empty
}


scenario #3: attempts to generate only value objects
----------------------------------------------------------------------------
/**
 * @struts.form
 *   name="CustomerForm"
 */
public class CustomerBean
{
  /** @struts.form-field name="CustomerForm" */ 
  public CustomerValue get/setCustomerValue();

  /** @struts.form-field name="CustomerForm" */
  public AccountValue getSetAccountValue();
}


xDoclet generate the following file:

public class CustomerCustomerForm  <--------- look at the name???
{
  // Only the following attributes
  public CustomerValue get/setCustomerValue();
  public AccountValue getSetAccountValue();
}


Do u know whats going on?

-----Original Message-----
From: Erik Hatcher [mailto:[EMAIL PROTECTED]]
Sent: 28 November 2002 16:56
To: Herve Tchepannou
Cc: xdoclet
Subject: Re: [Xdoclet-user] is there anyway to include value-objects in
strutsForm objects?


Could you elaborate on what you mean by this?  The short answer is "no",
but I'm not entirely clear on what you're after here.  Struts forms
should be merely placeholders for web forms... but they do not
necesarily have a one-to-one relationship to what folks refer to as
Value Objects.

        Erik


Herve Tchepannou wrote:
> is there anyway to include value-objects in strutsForm objects?
>
> *Herve Tchepannou*
> Software Engineer
> Objexis Coorporation
> Phone: (514) 932 3295 Ext. 231
> mailto:[EMAIL PROTECTED]
>
> *Objexis Coorporation*
> http://www.objexis.com
> 1635 Sherbrooke West, Suite #405
> Montreal, Qc H3H 1E2
> Tel: 514.932.3295
> Fax: 514.932.4639
> http://www.objexis.com
>
> *Important* - This message may contain privileged and confidential
> information.  It is intended only for the use of the individual(s) named
> above. If the reader of this message is not the intended recipient you
> are hereby notified that any use, dissemination, distribution or
> reproduction of this message is prohibited. If you have received this
> message in error please notify Objexis Corporation immediately and
> promptly delete this message and any copies thereof. Any views expressed
> in this message are those of the individual sender and may not
> necessarily reflect the views of Objexis Corporation.
>

Reply via email to