You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cayenne.apache.org by Michael Gentry <bl...@gmail.com> on 2008/03/02 18:13:34 UTC

Re: Extended Enumerations

http://cwiki.apache.org/confluence/display/CAYDOC/Extended+Types

First cut is checked into SVN.  If no problems, I'll add a couple more
features sometime.  I especially want to add localization support for
GUI developers.

Thanks,

/dev/mrg

PS. Ari, I've never used ROP and I think you are the big ROP guy.  If
you get a chance sometime, please test it a bit with ROP and let me
know if there are issues.  Thanks!

Re: Extended Enumerations

Posted by Michael Gentry <bl...@gmail.com>.
Hi Marcin,

When I split up the enum type handling (standard versus extended) as
suggested by Andrus, I can clean up that EnumType<T extends Enum<T>>
bit, I think.  The current EnumType which I checked in is supporting
two different types of enum, some of which implement
ExtendedEnumeration and some which do not, so I couldn't lock it down
to ExtendedEnumeration.

I believe for other custom extended types to auto-register themselves,
they'd have to implement an interface so Cayenne could map the values.
 It has been a long time since I looked specifically at that.  Perhaps
Andrus or another will correct me if I'm wrong on that matter.  I'm
not saying it wouldn't be nice, though.

Thanks,

/dev/mrg


On Mon, Mar 3, 2008 at 1:06 AM, Marcin Skladaniec <ma...@ish.com.au> wrote:
> Hi
>
>  The EnumType will be very handy indeed. I've read the code and have a
>  couple of questions:
>
>  EnumType<T extends Enum<T>> made my head square and then round again,
>  I dont understand it. Wouldn't a simpler EnumType<T extends
>  ExtendedEnumeration>  do ?
>
>  Would that be possible to make so all the ExtendedTypes (or just
>  EnumType)  would be auto-registered in the Node ? I believe it could
>  be done during the configuration initialization or when the node is
>  first accessed. Right now all the extended types must be registered,
>  and if you forget to do so it will only come up when the
>  materializeObject() method lookup will fail (from my experience
>  setJdbcObject will work somehow using enum ordinal() and will not
>  throw any exception).
>   From different perspective: why would someone add a custom java type
>  as a attribute and not register it ?  Maybe it should be another part
>  of the model/modeler where user defines available java types together
>  with their *Type classes ?
>
>  Best regards
>  Marcin
>
> -------------------------->
>  ish
>  http://www.ish.com.au
>  Level 1, 30 Wilson Street Newtown 2042 Australia
>  phone +61 2 9550 5001   fax +61 2 9550 4001
>
>
>
>
>
>
> On 03/03/2008, at 3:13 AM, Michael Gentry wrote:
>
>  > http://cwiki.apache.org/confluence/display/CAYDOC/Extended+Types
>  >
>  > First cut is checked into SVN.  If no problems, I'll add a couple more
>  > features sometime.  I especially want to add localization support for
>  > GUI developers.
>  >
>  > Thanks,
>  >
>  > /dev/mrg
>  >
>  > PS. Ari, I've never used ROP and I think you are the big ROP guy.  If
>  > you get a chance sometime, please test it a bit with ROP and let me
>  > know if there are issues.  Thanks!
>
>

Re: Extended Enumerations

Posted by Marcin Skladaniec <ma...@ish.com.au>.
Hi

The EnumType will be very handy indeed. I've read the code and have a  
couple of questions:

EnumType<T extends Enum<T>> made my head square and then round again,  
I dont understand it. Wouldn't a simpler EnumType<T extends  
ExtendedEnumeration>  do ?

Would that be possible to make so all the ExtendedTypes (or just  
EnumType)  would be auto-registered in the Node ? I believe it could  
be done during the configuration initialization or when the node is  
first accessed. Right now all the extended types must be registered,  
and if you forget to do so it will only come up when the  
materializeObject() method lookup will fail (from my experience  
setJdbcObject will work somehow using enum ordinal() and will not  
throw any exception).
 From different perspective: why would someone add a custom java type  
as a attribute and not register it ?  Maybe it should be another part  
of the model/modeler where user defines available java types together  
with their *Type classes ?

Best regards
Marcin
-------------------------->
ish
http://www.ish.com.au
Level 1, 30 Wilson Street Newtown 2042 Australia
phone +61 2 9550 5001   fax +61 2 9550 4001




On 03/03/2008, at 3:13 AM, Michael Gentry wrote:

> http://cwiki.apache.org/confluence/display/CAYDOC/Extended+Types
>
> First cut is checked into SVN.  If no problems, I'll add a couple more
> features sometime.  I especially want to add localization support for
> GUI developers.
>
> Thanks,
>
> /dev/mrg
>
> PS. Ari, I've never used ROP and I think you are the big ROP guy.  If
> you get a chance sometime, please test it a bit with ROP and let me
> know if there are issues.  Thanks!