Re: Adding setComment on SFieldMeta

[email protected] Thu, 01 Oct 2009 20:32:00 +1000
Newsgroups gmane.comp.java.orm.simpleorm
Message-ID <[email protected]>
Glad to see the meta data being used.  That was an original point of SimpleORM. 

There are actually several "Comments".

1. PROMPT, SHORT_PROMPT: Default field name in UI, possibly long and short.

2. DESCRIPTION, or TOOL_TIP: Tool tip like comment, a line or so.

3. COMMENT?: Technical comment.

Probably the first two are the mains ones.  They get concatenated to produce the commend DLL as 
PROMPT:- DESCRIPION
(say).  Include a delimiter such as :- so that they could be reverse engineered later.

An enum sort of defeats the purpose of user extensibility.  (Enums cannot be extended in Java, which greatly limits their usefulnes.)  If they are well known, then maybe they should just be properties of the object, with get/set methods?

SHORT_PROMPT should default to PROMPT, so there is some logic.  But how does one default DisplayLength from max length?  And know whether you have a default value or a set value?

Long ago I had a complex properties system that Franck (fortunately) deleted.  

I'm inclined to leave UserProperty for miscellaneous, and methods for known properties.  Certainly use String as parameter to UserProperty.

To unify them, could have UserProperty $PROMPT (say) just call getPrompt().  Could include max size, default display length etc.  Not sure if that is useful.  Do you ever really want to enumerate all the properties?  

It probably does not matter one way or the other.

Regards,

Anthony


At 07:51 PM 1/10/2009, you wrote:
>  
>
>Hi,
>
>I am making heavy use of a special UserProperty on my fields to store
>the field comments.
>
>On the one side, field comments act as a default field label in the UI
>(and possibly as a key for I18N), and on the other side, they can be
>used to generate a COMMENT DDL to make the database more readable.
>
>I was wondering if the community would agree to standardize on the
>following:
>
>1) create an enum for standard field properties, with only one value for
>now, being SFIELD_COMMENT. (the enum would be defined in SFieldMeta
>class)
>
>2) add two methods to SFieldMeta, setComment(String comment) and
>getComment(), that would call putUserProperty(SFIELD_COMMENT, comment)
>and getUserProperty(SFIELD_COMMENT);
>
>This would make the code more readable and easier to type than the
>lengthy putUserProperty form.
>
>3) maybe change the DDL generation part to create the COMMENT ON
>COLUMN ... statements (optional ?)
>
>What do you think of it ?
>
>Franck
>
>


Spreadsheet Detective,
Southern Cross Software Queensland Pty Limited
54 Gerler Street
Bardon, Queensland 4065, Australia.

Email: [email protected]
www.SpreadsheetDetective.com
Ph: +61 427 830248 (Australian Eastern Standard Time)

"If the model seems correct only because the numbers look right, 
then why build the model in the first place?"


------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/SimpleORM/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/SimpleORM/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[email protected] 
    mailto:[email protected]

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
21383179.jpg (image/jpeg, 3.3 KB) - not displayed