Fedor Karpelevitch <[EMAIL PROTECTED]> writes:

> Just wanted to check if anyone knows why the MapBuilder code looks like that:
> 
> public class AttachmentMapBuilder implements MapBuilder
> {
>     /** the name of this class */
>     public static final String CLASS_NAME = 
> "org.tigris.scarab.om.map.AttachmentMapBuilder";
> 
>     /** item */
>     public static String getTable( )
>     {
>         return "SCARAB_ATTACHMENT";
>     }
> 
> 
>     /** SCARAB_ATTACHMENT.ATTACHMENT_ID */
>     public static String getAttachment_AttachmentId()
>     {
>         return getTable() + ".ATTACHMENT_ID";
>     }
> 
>     /** SCARAB_ATTACHMENT.ISSUE_ID */
>     public static String getAttachment_IssueId()
>     {
>         return getTable() + ".ISSUE_ID";
>     }
> 
> .....
> 
> 
> since table name is known at template generation time it would be cleaner do 
> simply do:
> 
> /** SCARAB_ATTACHMENT.ATTACHMENT_ID */
>     public static String getAttachment_AttachmentId()
>     {
>         return "SCARAB_ATTACHMENT.ATTACHMENT_ID";
>     }
> 
> 
> or even not bother with functions at all and simply use static final 
> variables.
> 
> I would change this (cause it would seem cleaner that way) if no one shows me 
> why this needs to be the way it currently is.

The former scenario uses less memory if the code is not in use.  Since
that's not usually the case, +1 on your proposed change, Fedor.

Dan

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to