🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.swing
Article #12885

Re: Why aren't the Models of MVC JavaBeans?

#12885
From: Geoffrey L. Goetz
Date: Thu, 29 Oct 1998 00:00
71 lines
3825 bytes
Bob Arnson wrote:
>Geoffrey L. Goetz wrote:
>>The Views or Components are all JavaBeans, so why aren't the Models
>>JavaBeans?
>Because models are interfaces, not components.
>

I don't understand your comment.  Yes, there are interfaces defined for
models, but that is not all that models are.  At some point a model has
to be instanced and for this instancing to take place there must be some
sort of implementable object.  You can't really 'do' anything with just
an interface.  Each and every Swing component will take it upon itself
to create some sort of default model.

Are you perhaps implying that to be a JavaBean you must descend from
java.awt.Component or com.sun.java.swing.JComponent?

The JTextField will create some sort of default Document/Model when it
is created.  If I do not want to use this document (model) then I can
create an instance of a PlainDocument and set the JTextFields document
property to this model.

  ...
  JTextField jTextField1 = new JTextField();
  PlainDocument pdEmployeeName = new PlainDocument();
  ...
  [snip]
  ...
  jTextField1.setDocument(pdEmployeeName);
  ...

I cannot just create a Document or a Model.  I have to create an object
that implements the Document interface.

>You'll want to express your opinions on Swing to JavaSoft.

I thought about this.  I constantly wonder if JavaSoft should keep
expanding the functionality of the 'core' objects they supply.  Or if
companies like Inprise should descend from these core objects and add
value to the core objects.  Should JavaSoft create data aware Swing
Components, or should Inprise author dbSwing?  In this case should
JavaSoft "beanify" a collection of Models that implement certain
interfaces like Document, TreeModel and TableModel, or should companies
like Inprise add value to the JFC by creating a collection of
ModelBeans?  IMHO this is an idea that companies like Inprise should
implement.

Currently if I follow JBuilder's coding standards, the pdEmployeeName
object (above) I created in my frame will be accessible at design time
in the Component Tree on the Structure Pane under Other, and I can
access certain properties and events.  Could value be added to the JFC's
MVC architecture by creating a collection of ModelBeans?  Will
developers drag-and-drop custom ModelBeans on their applications?

-- 

                           \\|//
                         | (o o) |
  =-=-=-=-=-=-=-=-=-=-=-=-=-(_)-=-=-=-=-=-=-=-=-=-=-=-=-=
 _|__         ______                                  __|_
(____)       / _____)  ___   ______  _____  _____    (____)
(____)      / /  ___ / ___) / __  / / ____)/ ____)   (____)
(____)     / /___/ // ___) / /_/ / / ___) / ___)     (____)
(__)      /_______//_____)/_____/ /_/    /_/           (__)
  |                                                     |
  |        http://home.columbus.rr.com/ggeoffre         |
  |                                                     |
  |                    .oo0O   O0oo.                    |
  |                    (   )   (   )                    |
  =-=-=-=-=-=-=-=-=-=-=-\ (-=-=-) /-=-=-=-=-=-=-=-=-=-=-=
                         \_)   (_/
Technical Details
Message-ID: <3638E040.CAD69A4A@bottom.of.note.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <36379743.6F33EE95@bottom.of.note.com> <36385315.31915707@forums.borland.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: "Geoffrey L. Goetz" <please.read.sig@bottom.of.note.com>
Subject: Re: Why aren't the Models of MVC JavaBeans?
Date: 1998/10/29
Message-ID: <3638E040.CAD69A4A@bottom.of.note.com>
X-Deja-AN: 406449195
Content-Transfer-Encoding: 7bit
References: <36379743.6F33EE95@bottom.of.note.com> <36385315.31915707@forums.borland.com>
Content-Type: text/plain; charset=us-ascii
Organization: Another Netscape Collabra Server User
Mime-Version: 1.0
Newsgroups: borland.public.jbuilder.java.swing