;>
> >> private static final long b = 1;
> >>private static final long k = b * 1024;
> >>private static final long m = k * 1024;
> >>private static final long g = m * 1024;
> >>private static final long t = g * 1024;
> >>
> >
lementation of behavior on values. In addition to simplifying code, it
>> greatly increases cohesion by defining all of the uses of the value in one
>> place and using the compiler to validate coverage. Finally, it makes unit
>> testing of this conditional functionality much more st
actMethodError();
> }
> public long toTeraByte(long s) {
> throw new AbstractMethodError();
> }
> }
>
> This may explain some of my views on java enum. It does have lots of
> advantages like compiler check, native == operator. Just like
> Alex mentioned,
stick
to enum. But for types that plugin may extend, we'd
better to use own defined classes.
From: John Burwell [mailto:jburw...@basho.com]
Sent: Tuesday, July 23, 2013 6:25 AM
To: dev@cloudstack.apache.org
Subject: Re: [DESIGN] Why is enum a class...
All,
+1 to Alex's design suggest
Emm, it's not intended as a pun, but now I learned this pun :)
> -Original Message-
> From: Mike Tutkowski [mailto:mike.tutkow...@solidfire.com]
> Sent: Tuesday, July 23, 2013 8:43 AM
> To: dev@cloudstack.apache.org
> Subject: Re: [DESIGN] Why is enum a class...
&g
Type, it simply
> does:
>
> class MagicVmManagerImpl {
> public static final VmType type = new VmType("MagicVm");
> }
>
>
> > -Original Message-
> > From: Alex Huang [mailto:alex.hu...@citrix.com]
> > Sent: Monday, July 22, 2013 5:23
s
>> regard. Another way would be to use Spring to gather them and inject them
>> into a holding class.
>>
>> --Alex
>>
>>> -Original Message-
>>> From: Frank Zhang [mailto:frank.zh...@citrix.com]
>>> Sent: Monday, July 22, 2013 5:45 PM
ather them and inject them
> into a holding class.
>
> --Alex
>
> > -Original Message-
> > From: Frank Zhang [mailto:frank.zh...@citrix.com]
> > Sent: Monday, July 22, 2013 5:45 PM
> > To: dev@cloudstack.apache.org
> > Subject: RE: [DESIGN] Why is
uly 22, 2013 5:45 PM
> To: dev@cloudstack.apache.org
> Subject: RE: [DESIGN] Why is enum a class...
>
> Frankly speaking, if we are going to change enum, I would suggest not using
> enmu anymore, instead, defining our own class like:
>
> public class VmType
g [mailto:alex.hu...@citrix.com]
> Sent: Monday, July 22, 2013 5:23 PM
> To: dev@cloudstack.apache.org
> Subject: RE: [DESIGN] Why is enum a class...
>
> BTW, this code already shows a bug that stems from the static method usage.
> It says ElasticIpVm is not a system vm (which I
> -Original Message-
> From: Alex Huang [mailto:alex.hu...@citrix.com]
> Sent: Monday, July 22, 2013 5:14 PM
> To: dev@cloudstack.apache.org
> Subject: [DESIGN] Why is enum a class...
>
> I just went over this code and thought it was related and might be interested
&g
I just went over this code and thought it was related and might be interested
to other developers.
What's the difference between declaring a enum like this
public enum Type {
User,
DomainRouter,
ConsoleProxy,
SecondaryStorageVm,
ElasticIpVm,
12 matches
Mail list logo