Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.freenet.ag!feeder2.ecngs.de!ecngs!feeder.ecngs.de!Xl.tags.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!local2.nntp.ams.giganews.com!nntp.bt.com!news.bt.com.POSTED!not-for-mail NNTP-Posting-Date: Sun, 15 Jun 2014 06:04:09 -0500 From: "Chris Uppal" Newsgroups: comp.lang.java.programmer References: Subject: Re: use case for extending enum, but this is not possible in java Date: Sun, 15 Jun 2014 11:58:51 +0100 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5512 X-RFC2646: Format=Flowed; Response X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512 Message-ID: Lines: 19 X-Usenet-Provider: http://www.giganews.com X-AuthenticatedUsername: NoAuthUser X-Trace: sv3-Qwp/k0vod3weznz7J69KEXMp5rB+MVqlD93P+3eiQNCRyqDluAI8SEViZAIgFola7pTnXf9E1M36XGd!VW5oHvxSxgAgn0y3Ec0HkXeQJV4p4sy19NRgOg+8ipIGjSevhS5tWmKx+p4mSkZpn5x/uDVsPg== X-Complaints-To: abuse@btinternet.com X-DMCA-Complaints-To: abuse@btinternet.com X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 1916 Xref: csiph.com comp.lang.java.programmer:28747 Laura Schmidt wrote: > Now I am making a cut: The generic class Listing should be moved into > a generic java library, so that it can be used by different > applications. So I also need to move the interface ListCommandProcesor > into this library, and this would implicate that I also move the enum > ListCommand into the library. But the enum ListCommand ist application > specific. Think objects not integers (Java's enums aren't "integers in drag" anyway). You have these command "things". What does the general library need to know about them ? Anything ? If not then declare them as java.lang.Object. Otherwise either use an interface or generics (or both) to express the constraints on them. -- chris