Re: object orientation question
From: Big D (a_at_a.com)
Date: 03/13/04
- Next message: Richard: "Re: Pointer in VB.net"
- Previous message: Carlo: "Re: Value of Item in ListBox"
- In reply to: Tom Leylan: "Re: object orientation question"
- Next in thread: Tom Leylan: "Re: object orientation question"
- Reply: Tom Leylan: "Re: object orientation question"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 12 Mar 2004 21:45:05 -0700
Yes, they are two different constructors, but they are the same class, so if
foo.Item2 is readOnly, then what is the appropriate method to create a foo
and define item2? A "wrapper" method that just modifies the private member
that the property reads from, a constructor that takes in item2, or a shared
method that returns an instance of foo, or is it all just personal taste?
Thanks for the response!
-D
"Tom Leylan" <gee@iamtiredofspam.com> wrote in message
news:OagYpcKCEHA.3568@tk2msftngp13.phx.gbl...
> "Big D" <a@a.com> wrote...
>
> This example of an existing Foo:
>
> > Dim myFoo as new Foo(433)
>
> And this example of a new Foo:
>
> > Dim myFoo as new Foo()
> > myFoo.Item1 = 3
> > myFoo.Item2 = 4
> > myFoo.insert()
>
> would access two different constructors... so you can assume that if you
are
> using the first constructor that the object has not just been created. If
> you set a flag to indicate if the object is new you can set it to True in
> the second constructor and False in the first one. If you have a "write
> once" property like Item2 you check the flag and permit it to be assigned
so
> long as the flag is set.
>
> Tom Leylan
>
>
- Next message: Richard: "Re: Pointer in VB.net"
- Previous message: Carlo: "Re: Value of Item in ListBox"
- In reply to: Tom Leylan: "Re: object orientation question"
- Next in thread: Tom Leylan: "Re: object orientation question"
- Reply: Tom Leylan: "Re: object orientation question"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|