Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #2552
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!aioe.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail |
|---|---|
| From | markspace <-@.> |
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: Enums: Properties vs. Methods |
| Date | Tue, 29 Mar 2011 09:26:36 -0700 |
| Organization | A noiseless patient Spider |
| Lines | 29 |
| Message-ID | <imt17u$892$1@dont-email.me> (permalink) |
| References | <2f38bb8e-9a8d-4464-ad3d-b9ce0b557219@e21g2000yqe.googlegroups.com> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=ISO-8859-1; format=flowed |
| Content-Transfer-Encoding | 7bit |
| Injection-Date | Tue, 29 Mar 2011 16:26:39 +0000 (UTC) |
| Injection-Info | mx02.eternal-september.org; posting-host="mZZsLHtx2uLqa4fpyB5uww"; logging-data="8482"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+aCjvwcuUTE2xZqKvMydU48S8yhkp9d7Y=" |
| User-Agent | Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.15) Gecko/20110303 Thunderbird/3.1.9 |
| In-Reply-To | <2f38bb8e-9a8d-4464-ad3d-b9ce0b557219@e21g2000yqe.googlegroups.com> |
| Cancel-Lock | sha1:k5b4TFqy/d5h073Ov2B1EDoNa8Y= |
| Xref | x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:2552 |
Show key headers only | View raw
On 3/29/2011 8:18 AM, Robert Klemme wrote:
> /** We use custom methods. */
> public enum Meth {
I agree with Lew that this second example was pretty confusing and hard
to follow. I also think that it's difficult to predict memory usage
without careful analysis.
I'd like to see a "motivating" example. What do you actually intend to
use this for? I can't see that a general case is too interesting,
except to disqualify the method pattern.
> Then different
> enums can have differing implementations of the method and we have an
> instance of Strategy / State pattern.
I don't think State works this way. Strategy ... maybe, but the use of
enums for Strategy seems confining. I'd just use regular inheritance
and classes. The "method pattern" for Strategy would be fine I think if
it weren't shoe-horned into an enum.
> Full toy class https://gist.github.com/892503#file_prop_vs_meth.java
I'll check it out.
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar
Enums: Properties vs. Methods Robert Klemme <shortcutter@googlemail.com> - 2011-03-29 08:18 -0700
Re: Enums: Properties vs. Methods Lew <noone@lewscanon.com> - 2011-03-29 11:47 -0400
Re: Enums: Properties vs. Methods Robert Klemme <shortcutter@googlemail.com> - 2011-03-30 20:00 +0200
Re: Enums: Properties vs. Methods Lew <lew@lewscanon.com> - 2011-03-30 13:17 -0700
Re: Enums: Properties vs. Methods Robert Klemme <shortcutter@googlemail.com> - 2011-03-31 00:48 -0700
Re: Enums: Properties vs. Methods Lew <noone@lewscanon.com> - 2011-03-31 08:41 -0400
Re: Enums: Properties vs. Methods Robert Klemme <shortcutter@googlemail.com> - 2011-03-31 08:26 -0700
Re: Enums: Properties vs. Methods Lew <noone@lewscanon.com> - 2011-03-31 22:16 -0400
Re: Enums: Properties vs. Methods Robert Klemme <shortcutter@googlemail.com> - 2011-04-02 11:56 +0200
Re: Enums: Properties vs. Methods Lew <noone@lewscanon.com> - 2011-04-02 10:29 -0400
Re: Enums: Properties vs. Methods Robert Klemme <shortcutter@googlemail.com> - 2011-04-03 13:14 +0200
Re: Enums: Properties vs. Methods markspace <-@.> - 2011-03-29 09:26 -0700
Re: Enums: Properties vs. Methods Robert Klemme <shortcutter@googlemail.com> - 2011-03-30 20:06 +0200
Re: Enums: Properties vs. Methods markspace <-@.> - 2011-03-30 12:40 -0700
Re: Enums: Properties vs. Methods Robert Klemme <shortcutter@googlemail.com> - 2011-03-31 00:38 -0700
Re: Enums: Properties vs. Methods Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid> - 2011-03-29 19:03 +0200
Re: Enums: Properties vs. Methods Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid> - 2011-03-29 19:04 +0200
Re: Enums: Properties vs. Methods Roedy Green <see_website@mindprod.com.invalid> - 2011-03-29 12:49 -0700
Re: Enums: Properties vs. Methods Roedy Green <see_website@mindprod.com.invalid> - 2011-03-29 12:52 -0700
Re: Enums: Properties vs. Methods Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid> - 2011-03-29 22:45 +0200
Re: Enums: Properties vs. Methods Lew <noone@lewscanon.com> - 2011-03-29 17:08 -0400
Re: Enums: Properties vs. Methods Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid> - 2011-03-29 23:25 +0200
Re: Enums: Properties vs. Methods Lew <noone@lewscanon.com> - 2011-03-29 19:05 -0400
Re: Enums: Properties vs. Methods Lew <noone@lewscanon.com> - 2011-03-29 19:40 -0400
Re: Enums: Properties vs. Methods Robert Klemme <shortcutter@googlemail.com> - 2011-03-31 02:57 -0700
Re: Enums: Properties vs. Methods Lew <noone@lewscanon.com> - 2011-03-31 08:52 -0400
Re: Enums: Properties vs. Methods Lew <noone@lewscanon.com> - 2011-03-31 08:54 -0400
Re: Enums: Properties vs. Methods Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid> - 2011-03-30 18:40 +0200
Re: Enums: Properties vs. Methods Lew <lew@lewscanon.com> - 2011-03-30 10:33 -0700
Re: Enums: Properties vs. Methods Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid> - 2011-03-30 20:43 +0200
Re: Enums: Properties vs. Methods Lew <lew@lewscanon.com> - 2011-03-30 13:20 -0700
Re: Enums: Properties vs. Methods Lew <noone@lewscanon.com> - 2011-03-31 08:55 -0400
Re: Enums: Properties vs. Methods Wanja Gayk <brixomatic@yahoo.com> - 2011-04-02 11:23 +0200
Re: Enums: Properties vs. Methods Lew <noone@lewscanon.com> - 2011-04-02 10:36 -0400
Re: Enums: Properties vs. Methods Wanja Gayk <brixomatic@yahoo.com> - 2011-04-02 21:20 +0200
csiph-web