On 6/12/06, Guillermo Roditi <[EMAIL PROTECTED]> wrote: > maybe it'll help if i explain what I am trying to do. > > I am trying to make a simple todo list as a simple learning excercise. > I'd like to have a Todo list, which can have multiple items. > I was thinking each item could be a compound field composed of an id, a > title and a due date for example.
I imagine that you want those three fields to give you an Item object of some kind, server-side. That's on the borderline between something that should be a form and something that's okay as a compound field. For example, consider date-related fields that have DateTime objects as internal values. You may say, "There are many compound fields for representing DateTime objects, so my compound field representing an Item object is fine too." OTOH, DateTime objects are not specific to your app, and there are many common single-string representations of dates. So it is unlike your Item example in several ways as well. In the end, it's a judgment call. I usually prefer to use a Form for anything that is expected to represent a "domain object" (i.e., an object that's part of my application's domain model), not the least of which because I'm almost sure to have some need to view/edit a single one of those objects at some point. But like I said, it's really up to you. If you do decide to go with a compound field, I suggest coming up with a sensible single-string representation. For example, if your ids are numeric, something as simple as "id:date:title" might work. The id and date should be easy to parse, leaving the free-form title as "the rest." (Of course, parsing and formatting string values like this is another thing you wouldn't have to worry about if you used nested forms instead of compound fields :) > I thought about making the field a subform, but i saw the earlier thread from > march on the archives and it led me to think that maybe making it a separate > field would be a better idea, since an item would be acting kind of like a > field within the form. > > any advice would be greatly appreciated, as i understand i probably am not > going about this the right way. It really is a judgment call. Use the one that makes the most sense to you in the context of your app. -John _______________________________________________ Rose-db-object mailing list Rose-db-object@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rose-db-object