Puzzled with MVP, specially the V

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Puzzled with MVP, specially the V

Fernando Rodríguez
Hi,

Are 'views' classes too? What's their place in hte class hierarchy?

Thanks


Reply | Threaded
Open this post in threaded view
|

Re: Puzzled with MVP, specially the V

Yar Hwee Boon-3
On Fri, 14 Jan 2005 17:13:15 +0100, Fernando <[hidden email]> wrote:

> Are 'views' classes too? What's their place in hte class hierarchy?

You can try reading the Taligent paper on MVP. "Views" are instances of  
the class View and its subclasses. What you edit in the View composer is  
the prototype instance. What do you by their place in the class hierarchy?

--
Regards
HweeBoon
MotionObj


Reply | Threaded
Open this post in threaded view
|

Re: Puzzled with MVP, specially the V

Fernando Rodríguez
On Sat, 15 Jan 2005 00:19:02 +0800, "Yar Hwee Boon"
<[hidden email]> wrote:

>On Fri, 14 Jan 2005 17:13:15 +0100, Fernando <[hidden email]> wrote:
>
>> Are 'views' classes too? What's their place in hte class hierarchy?
>
>You can try reading the Taligent paper on MVP. "Views" are instances of  
>the class View and its subclasses.

I'll check it out.

> What you edit in the View composer is  
>the prototype instance. What do you by their place in the class hierarchy?

I thought every view was a different subclass of some View class, not
instances.


Reply | Threaded
Open this post in threaded view
|

Re: Puzzled with MVP, specially the V

Yar Hwee Boon-3
On Fri, 14 Jan 2005 17:39:33 +0100, Fernando <[hidden email]> wrote:

> I thought every view was a different subclass of some View class, not
> instances.

Every view is an instance of some subclass of View (or View itself). What  
I mean is that when you edit a view in the view composer, you are not  
editing View or one of its subclass, you are editing a prototype instance  
of View or one of its subclass. For eg. inspect GroupBox allInstances in a  
workspace. You will probably see that it is empty. Now open the view  
composer on the "Static group box" resource. You run the code in the  
workspace again, there should be 1 instance. That is what I mean by  
editing the prototype instance.

--
Regards
HweeBoon
MotionObj


Reply | Threaded
Open this post in threaded view
|

Re: Puzzled with MVP, specially the V

Schwab,Wilhelm K
In reply to this post by Fernando Rodríguez
Fernando,

> I thought every view was a different subclass of some View class, not
> instances.

Views are instances, but then so are classes =:0   You might search for
"The Strap" as a little Dolphin history.  I should mention that I recall
reading about it; I do not recall where I read it.

Anecdotes aside, the view in an MVP triad is indeed an instance of a
class that is probably derived from View.  A given presenter might be
able to work with any number of views, which do not necessarily need to
be of one class.

Hwee Boon's reference to prototype instances is quite correct, and
refers to the GoF prototype pattern.  The idea is that the VC edits one
instance that is "once" tweaked and saved (serialized using the binary
filer), and "many times" later copied (deserialized) for use.

Have a good one,

Bill


--
Wilhelm K. Schwab, Ph.D.
[hidden email]


Reply | Threaded
Open this post in threaded view
|

Re: Puzzled with MVP, specially the V

Fernando Rodríguez
On Fri, 14 Jan 2005 16:52:21 -0500, Bill Schwab
<[hidden email]> wrote:


>Views are instances, but then so are classes =:0   You might search for
>"The Strap" as a little Dolphin history.  I should mention that I recall
>reading about it; I do not recall where I read it.

I tried searching it on google groups, but couldn't find it...