Path: csiph.com!usenet.pasdenom.info!news.albasani.net!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: markspace <-@.> Newsgroups: comp.lang.java.programmer Subject: Re: How is this "pattern" called? Date: Fri, 18 May 2012 08:29:56 -0700 Organization: A noiseless patient Spider Lines: 34 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Fri, 18 May 2012 15:29:58 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="tCs9q+zYIgWty87qnomMxw"; logging-data="20265"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+DGCiwNbJfjuvgr52cEKhFfGSWSSwakqA=" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 In-Reply-To: Cancel-Lock: sha1:yUsfxWh6MpzlON60apQB/60BxPM= Xref: csiph.com comp.lang.java.programmer:14620 On 5/18/2012 1:53 AM, Stefan Ram wrote: > In the MVC pattern, I think, M, V, and C should be at least > one non-innner class each? > > I often have seen (possibly, especially in beginner code) a > coding pattern, where there is only one single non-inner class: > the model. "Especially in beginner code" seems to say to me that they might be copying from beginner examples, especially of the sort that appear in Oracle's Java tutorial. These example are designed to be shorter to read on a web page or book page, and don't show best practice or correct pattern. The examples simply show how to use the API. Also, MVC is not MVC. That is, most languages and frameworks use a modified MVC that really isn't MVC. Java itself uses a "split model" design pattern. Model-Presenter-Controller is currently a popular design pattern which can be used in Java. > > The listeners and the view then are embedded into this > model, possibly, as inner classes. It's not really MVC > as the observer pattern is not used for decoupling. "Close coupling" is an anti-pattern in most cases. Do you have an example we could look at?