Article View: borland.public.jbuilder.java.swing
Article #12662Re: Why aren't the Models of MVC JavaBeans?
From: Richard Wilkman
Date: Wed, 18 Nov 1998 00:00
Date: Wed, 18 Nov 1998 00:00
90 lines
4898 bytes
4898 bytes
Geoffrey: My take is that models should be as separate and distinct from their views as possible. That distance is key, in my mind, to good MV architecture. Views tend to have some visual aspect that works in Designer tools but you don't just drop down a non-trivial model and get feedback. If you happen to have a fully constructed model around you can bind a view to it in a visual environment, of course. To me, it doesn't make sense to burden the model (a container for data) with all the overhead to make it "better in a bean/visual environment". You should be able to pass a model around efficiently, just like any other data structure. I don't think it's a safe assumption that a model will be bound to a visual-widget always. The TreeModel in JFC is pretty handy all by itself, for example. If you want to "see" it, then you bind it to a view object that can do something with it (JTree, but it doesn't have to be that obvious"). I also like the factory concept you see more of in JFC. There is a model factory that you can go get a base model or some variant from at the point you need it (which could be runtime and not designtime). Just my .02., of course. -Rich Geoffrey L. Goetz wrote: > > "Ross M. Dukeshier" wrote: > > Just an aside - if I remember correctly, one of the requirements to > > being a java bean was that the class implement a parameterless > > constructor. You referenced DefaultTreeModel - it doesn't have one... > > > > Didn't check if that was true of all the models, but I figured it may > > explain at least one... > > > > As I feared, my original questions and attempts to discuss have been > misinterpreted. I was not trying to ask "why doesn't the square peg fit > into the round hole" rather I was trying to discuss the reasons "why the > square peg wasn't a round peg to begin with?". I will shoulder the > blame of the misinterpretation. > > Should the models behind the visual components be developed and extended > separately as JavaBeans and if so, would easier access to these models > be of benefit to developers? Is keeping the model separate from the > visual component in the IDE a good or bad thing? Are people defining > custom models similar in responsibility to DataExpress's DataSet > Objects? I feel that the visual components themselves have been and > will continue to be unnecessarily overburdened to also include an > interface into the model's attributes and events. Should the details > MVC in swing survive and propagate into the day to day development, or > is it just a good idea that is best kept under the hood so to speak? > > IMHO, developing a rich set of models that can easily be added to an > application that are not tied to a database would be of considerable > value. > > -- > \\|// > | (o o) | > =-=-=-=-=-=-=-=-=-=-=-=-=-(_)-=-=-=-=-=-=-=-=-=-=-=-=-= > _|__ ______ __|_ > (____) / _____) ___ ______ _____ _____ (____) > (____) / / ___ / ___) / __ / / ____)/ ____) (____) > (____) / /___/ // ___) / /_/ / / ___) / ___) (____) > (__) /_______//_____)/_____/ /_/ /_/ (__) > | | > | http://home.columbus.rr.com/ggeoffre | > | | > | .oo0O O0oo. | > | ( ) ( ) | > =-=-=-=-=-=-=-=-=-=-=-\ (-=-=-) /-=-=-=-=-=-=-=-=-=-=-= > \_) (_/ -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Rich Wilkman Senior Quality Assurance Engineer Borland JBuilder Team If you see something that looks like an opinion up there, it's mine and mine alone. Mail sent to me from the newsgroups won't bounce but will be ignored. If I have time, I'll respond, but you have a better chance if you confine your posts to the newsgroups =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Technical Details
Message-ID:
<365339C8.B258F5B4@inprise.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<36379743.6F33EE95@bottom.of.note.com> <36385315.31915707@forums.borland.com> <3638E040.CAD69A4A@bottom.of.note.com> <363adb7f.10544254@forums.borland.com> <364D2769.58A6@flash.net> <36524A36.10926968@bottom.of.note.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,1f864db81a13c8b0 X-Google-Attributes: gid111d45,public From: Richard Wilkman <rwilkman@inprise.com> Subject: Re: Why aren't the Models of MVC JavaBeans? Date: 1998/11/18 Message-ID: <365339C8.B258F5B4@inprise.com> X-Deja-AN: 413277388 Content-Transfer-Encoding: 7bit References: <36379743.6F33EE95@bottom.of.note.com> <36385315.31915707@forums.borland.com> <3638E040.CAD69A4A@bottom.of.note.com> <363adb7f.10544254@forums.borland.com> <364D2769.58A6@flash.net> <36524A36.10926968@bottom.of.note.com> Content-Type: text/plain; charset=us-ascii Organization: Another Netscape Collabra Server User Mime-Version: 1.0 Newsgroups: borland.public.jbuilder.java.swing