Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail From: sclaflin@webucator.com Newsgroups: comp.lang.java.programmer Subject: Re: Hairy generics question Date: Sat, 25 Feb 2012 10:27:58 -0800 (PST) Organization: http://groups.google.com Lines: 32 Message-ID: <18147154.963.1330194478893.JavaMail.geo-discussion-forums@vbai14> References: <3c65271e-a388-49c9-bcc6-ca3bf274e74f@e27g2000vbu.googlegroups.com> <29108397.63.1330110725245.JavaMail.geo-discussion-forums@vbpw21> <7822487.176.1330121248108.JavaMail.geo-discussion-forums@vbkl3> NNTP-Posting-Host: 96.227.80.185 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1330194479 30749 127.0.0.1 (25 Feb 2012 18:27:59 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sat, 25 Feb 2012 18:27:59 +0000 (UTC) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=96.227.80.185; posting-account=SVWHxwoAAAAHgCbAu0-fW388NuDxpM9h User-Agent: G2/1.0 X-Google-Web-Client: true X-Received-Bytes: 3107 Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:12326 On Friday, February 24, 2012 6:36:37 PM UTC-5, Daniel Pitts wrote: > In what way is a Presenter different from a "controller". View's should= =20 > never know about Controllers, only about models. Controllers know about= =20 > specific views and specific models. Models know about generic=20 > listeners, if you need to have an active view (non web-app stuff). In my preferred concept of MVP, a view doesn't work directly with the model= , which is why I suffixed my T type with Info. It's possible for the view t= o not know about the presenter, and a lot of MVP is done that way. But that= requires the view to fire events that the presenter then registers to hand= le. My problem with that approach is twofold: 1. It burdens a global event bus with lots of events that were only meant t= o be one source to one handler. Especially in my app, where most of my vie= ws would fire events like editRequested or deleteRequested (most of these w= idgets are display-only, the edits are done via a popup). So, the global e= vent manager is going to have to hold a list of handlers for each event for= all these views, and then iterate through the appropriate list each time t= o find the handler that matches the event source. While intellectually ple= asing from a maximum decoupling perspective, it's not very efficient. 2. It exposes what ought to private publicly, that being the event registra= tion methods. The view shouldn't be visible to anything but its presenter,= but public void addEditRequestedHandler could be called from anywhere that= has a reference to the view. Granted, that reference shouldn't be held an= ywhere but in the presenter, but I could see someone that perceives MVP dif= ferently passing the reference outside the presenter.