Re: Using "enums" in the code

2011-01-14 Thread Nirmal Fernando
Thanks Lily!!

On Sat, Jan 15, 2011 at 12:44 AM, Lily Wei  wrote:

> Hi Nirmal:
>  +1 for me on new implementation with enum.
>
> Thanks,
> Lily
>
> On Jan 14, 2011, at 10:34 AM, Nirmal Fernando 
> wrote:
>
> Thanks Knut and Kathey for your replies! I also thought in same way! So, if
> no objection I will start implementing using Enums!
>
> On Fri, Jan 14, 2011 at 9:04 PM, Kathey Marsden <
> [email protected]> wrote:
>
>> On 1/14/2011 6:58 AM, Knut Anders Hatlen wrote:
>>
>>>
>>> Hi Nirmal,
>>>
>>> The question here is whether the plan exporter tool should work on Java
>>> 1.4 or not. I don't think losing the ability to run the plan exporter on
>>> 1.4 would be a very big problem, so I'd say that if you think the
>>> improvements will be much easier to implement using enums, using Java 5
>>> for that tool would probably be fine. Most users are on Java 6 these
>>> days, and I don't think this is a tool that would typically be used on
>>> the CDC platform. Others may disagree, though.
>>>
>>>  I think that is fine.  I don't think it is even documented yet and it
>> seems perfectly acceptable to me for new features, especially tools  to have
>> a minimum java rev level higher than 1.4.2.   Is Plan Exporter something
>> that is supposed to work on small devices or is it not available on J2ME?
>>
>
> I am not quite sure about this !
>
>
>>
>> Kathey
>>
>>
>>
>
>
> --
> Best Regards,
> Nirmal
>
> C.S.Nirmal J. Fernando
> Department of Computer Science & Engineering,
> Faculty of Engineering,
> University of Moratuwa,
> Sri Lanka.
>
> Blog:  http://nirmalfdo.blogspot.com/
>
>


-- 
Best Regards,
Nirmal

C.S.Nirmal J. Fernando
Department of Computer Science & Engineering,
Faculty of Engineering,
University of Moratuwa,
Sri Lanka.

Blog: http://nirmalfdo.blogspot.com/


Re: Using "enums" in the code

2011-01-14 Thread Lily Wei
Hi Nirmal:
 +1 for me on new implementation with enum.

Thanks,
Lily

On Jan 14, 2011, at 10:34 AM, Nirmal Fernando  wrote:

> Thanks Knut and Kathey for your replies! I also thought in same way! So, if 
> no objection I will start implementing using Enums!
> 
> On Fri, Jan 14, 2011 at 9:04 PM, Kathey Marsden  
> wrote:
> On 1/14/2011 6:58 AM, Knut Anders Hatlen wrote:
> 
> Hi Nirmal,
> 
> The question here is whether the plan exporter tool should work on Java
> 1.4 or not. I don't think losing the ability to run the plan exporter on
> 1.4 would be a very big problem, so I'd say that if you think the
> improvements will be much easier to implement using enums, using Java 5
> for that tool would probably be fine. Most users are on Java 6 these
> days, and I don't think this is a tool that would typically be used on
> the CDC platform. Others may disagree, though.
> 
> I think that is fine.  I don't think it is even documented yet and it seems 
> perfectly acceptable to me for new features, especially tools  to have a 
> minimum java rev level higher than 1.4.2.   Is Plan Exporter something that 
> is supposed to work on small devices or is it not available on J2ME?
> 
> I am not quite sure about this !
>  
> 
> Kathey
> 
> 
> 
> 
> 
> -- 
> Best Regards,
> Nirmal
> 
> C.S.Nirmal J. Fernando
> Department of Computer Science & Engineering,
> Faculty of Engineering,
> University of Moratuwa,
> Sri Lanka.
> 
> Blog: http://nirmalfdo.blogspot.com/
> 


Re: Using "enums" in the code

2011-01-14 Thread Nirmal Fernando
Thanks Knut and Kathey for your replies! I also thought in same way! So, if
no objection I will start implementing using Enums!

On Fri, Jan 14, 2011 at 9:04 PM, Kathey Marsden  wrote:

> On 1/14/2011 6:58 AM, Knut Anders Hatlen wrote:
>
>>
>> Hi Nirmal,
>>
>> The question here is whether the plan exporter tool should work on Java
>> 1.4 or not. I don't think losing the ability to run the plan exporter on
>> 1.4 would be a very big problem, so I'd say that if you think the
>> improvements will be much easier to implement using enums, using Java 5
>> for that tool would probably be fine. Most users are on Java 6 these
>> days, and I don't think this is a tool that would typically be used on
>> the CDC platform. Others may disagree, though.
>>
>>  I think that is fine.  I don't think it is even documented yet and it
> seems perfectly acceptable to me for new features, especially tools  to have
> a minimum java rev level higher than 1.4.2.   Is Plan Exporter something
> that is supposed to work on small devices or is it not available on J2ME?
>

I am not quite sure about this !


>
> Kathey
>
>
>


-- 
Best Regards,
Nirmal

C.S.Nirmal J. Fernando
Department of Computer Science & Engineering,
Faculty of Engineering,
University of Moratuwa,
Sri Lanka.

Blog: http://nirmalfdo.blogspot.com/


Re: Using "enums" in the code

2011-01-14 Thread Kathey Marsden

On 1/14/2011 6:58 AM, Knut Anders Hatlen wrote:


Hi Nirmal,

The question here is whether the plan exporter tool should work on Java
1.4 or not. I don't think losing the ability to run the plan exporter on
1.4 would be a very big problem, so I'd say that if you think the
improvements will be much easier to implement using enums, using Java 5
for that tool would probably be fine. Most users are on Java 6 these
days, and I don't think this is a tool that would typically be used on
the CDC platform. Others may disagree, though.

I think that is fine.  I don't think it is even documented yet and it 
seems perfectly acceptable to me for new features, especially tools  to 
have a minimum java rev level higher than 1.4.2.   Is Plan Exporter 
something that is supposed to work on small devices or is it not 
available on J2ME?


Kathey




Re: Using "enums" in the code

2011-01-14 Thread Knut Anders Hatlen
Nirmal Fernando  writes:

> Hi Knut, thanks for the quick response!
>
> I am looking into "Add all data in XPlain tables into the XML file
> generated by PlanExporter Tool"
> (https://issues.apache.org/jira/browse/DERBY-4783) improvement, and I
> felt that it will be really inefficient to use large number of "int
> Enum patterns"[1] and case statements. So that is why I am wondering
> whether it is ok to use "Typesafe Enum pattern"[1] in PlanExporter.

Hi Nirmal,

The question here is whether the plan exporter tool should work on Java
1.4 or not. I don't think losing the ability to run the plan exporter on
1.4 would be a very big problem, so I'd say that if you think the
improvements will be much easier to implement using enums, using Java 5
for that tool would probably be fine. Most users are on Java 6 these
days, and I don't think this is a tool that would typically be used on
the CDC platform. Others may disagree, though.

-- 
Knut Anders


Re: Using "enums" in the code

2011-01-14 Thread Nirmal Fernando
Hi Knut, thanks for the quick response!

I am looking into "Add all data in XPlain tables into the XML file generated
by PlanExporter Tool" (https://issues.apache.org/jira/browse/DERBY-4783)
improvement, and I felt that it will be really inefficient to use large
number of "int Enum patterns"[1] and case statements. So that is why I am
wondering whether it is ok to use "*Typesafe Enum* pattern**"[1] in
PlanExporter.

I really appreciate your valuable opinion on this to proceed with this
improvement!

Thanks!

[1] http://download.oracle.com/javase/1.5.0/docs/guide/language/enums.html

On Fri, Jan 14, 2011 at 6:33 PM, Knut Anders Hatlen 
wrote:
>
> Nirmal Fernando  writes:
>
> > Hi All,
> >
> > Is there away to use "enums" in Derby, I mean is it possible to say
> > Ant to avoid using Java 1.4 for compiling classes where enums are
> > used, and use Java 1.5 instead?
>
> Hi Nirmal,
>
> It is possible. See for example
> java/testing/org/apache/derbyTesting/functionTests/util/build.xml and
> java/engine/org/apache/derby/impl/services/build.xml which contain javac
> targets with source and target level set to 1.5:
>
>  source="1.5"
>  target="1.5"
>  ...
>
> The classes that are compiled this way can only be used on a Java 1.5 or
> higher VM, so this technique cannot be used in core functionality unless
> an alternative implementation that works on Java 1.4 is provided. For
> example, we have a lock manager implementation that depends on
> java.util.concurrent.ConcurrentHashMap for performance reasons, but
> since ConcurrentHashMap is only available on Java 1.5 and higher, we use
> another implementation that's based on java.util.HashMap on older
> platforms.
>
> --
> Knut Anders



--
Best Regards,
Nirmal

C.S.Nirmal J. Fernando
Department of Computer Science & Engineering,
Faculty of Engineering,
University of Moratuwa,
Sri Lanka.
Blog: http://nirmalfdo.blogspot.com/


Re: Using "enums" in the code

2011-01-14 Thread Knut Anders Hatlen
Nirmal Fernando  writes:

> Hi All,
>
> Is there away to use "enums" in Derby, I mean is it possible to say
> Ant to avoid using Java 1.4 for compiling classes where enums are
> used, and use Java 1.5 instead?

Hi Nirmal,

It is possible. See for example
java/testing/org/apache/derbyTesting/functionTests/util/build.xml and
java/engine/org/apache/derby/impl/services/build.xml which contain javac
targets with source and target level set to 1.5: