Article View: borland.public.jbuilder.java.swing
Article #13047Re: Model-View-Control; can anyone demonstrate this to me?
From: Paul Furbacher
Date: Mon, 28 Sep 1998 00:00
Date: Mon, 28 Sep 1998 00:00
38 lines
2226 bytes
2226 bytes
ICS wrote: > Anyone feel that they have a real philosophical understanding of the > model-view-controller architecture and have grounded this into > practicality... if you have an example that you wouldn't mind sharing with > me -- I'd love to see it. A good starting point would be the JBuilder Developer's Guide. Chapter 33 is pretty lucid (at least I think so). Also, some background reading, provided to you by Javasoft. (Swing is MVC-based.) http://java.sun.com/products/jfc/tsc/swingdoc-static/swing-arch.html Once you read this, go on to read about the Swing JTree: http://www.javasoft.com/products/jfc/tsc/swingdoc-current/trees-tables.html http://www.javasoft.com/products/jfc/tsc/swingdoc-current/tree_model.html Finally, study the source code for an MVC-based component like the ListControl. Chapter 34 dissects the ListControl. And once you have that down, start thinking about how you would organize your application around MVC. That is, completely segregating views (frames, dialog boxes) from models (data structures and get/set methods associated with them), with a controller to mediate behavior demanded by events which come from menu items and from user interaction with view components (buttons, comboboxes, lists, trees, tables, etc.). Set three rules for your design: 1) no view shall know the name of a piece of data; 2) no data structure shall know the name of a view; and 3) no major view (frame/dialog) shall know the name of another major view. [Hint: the controller knows everybody.] Paul Furbacher
Technical Details
Message-ID:
<36104BB6.FE472040@bilbo.bio.purdue.edu>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<01bdeb00$9f60f1e0$d3fa07d0@ics>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,6aab509524e528b0 X-Google-Attributes: gid111d45,public From: Paul Furbacher <pf@bilbo.bio.purdue.edu> Subject: Re: Model-View-Control; can anyone demonstrate this to me? Date: 1998/09/28 Message-ID: <36104BB6.FE472040@bilbo.bio.purdue.edu> X-Deja-AN: 395843741 Content-Transfer-Encoding: 7bit References: <01bdeb00$9f60f1e0$d3fa07d0@ics> To: ICS <jweder@icsaward.com> Content-Type: text/plain; charset=us-ascii Organization: Biological Sciences, Purdue Univ. Mime-Version: 1.0 Reply-To: pf@bilbo.bio.purdue.edu Newsgroups: borland.public.jbuilder.java.swing