OOP and properties in VB

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

--
hello

When using properties with OOP, VB6 had Get/Let and VB.net has Readonly/and
....

Are theses OOP concepts with Property use or only specific to Visual Basic
properties,

With this property use does C++ have this as well or just Visual C++.?
 
John,

In dotNet all programs made in managed code can use mixed the classes made
and which are in a DLL (libary) as if they where made by the same languages.

The way properties are created and used in the languages itself is specific
to those languages.

Is that your question?

Cor
 
So some features of OOP in VB.net (and vb6) are not standard OOP features
but Micosoft add-ons...so all OOP languages must have an amount of add-ons
not found in OOP general concepts.
 
So some features of OOP in VB.net (and vb6) are not standard OOP features
but Micosoft add-ons...so all OOP languages must have an amount of add-ons
not found in OOP general concepts.
What you write for VB6 is true, not for VBNet. I had not the idea I have
written that in any way, you make me curious, what sentence of my did let
you make that conclussion. All Net languages follow the general concept of
OOP. VB6 does not.

VBNet and VB6 have beside the most classic VB keywords not so much in
common, therefore I don't understand why you connect them.

Cor
 
You can do basic OOP in VB6....which are good enough for IMO decent OOP.
VB.net isnt that different to VB6 in a lot of ways if you already know some
OOP and Java,C
The architecture of .Net is behind the scenes is different.

Anyway I was actually refering to the fact that C++ doesnt have properties
which you set Readonly like VB.net (I couldnt find it in Borland C++) and
wondered if these were VB ideas?

I kind of see C++ as the OOP (defacto) standard .
 
John,

You can see everything as your own (defacto) standard, feel free to that.

However that does not say it is.

Cor
 
Anyway I was actually refering to the fact that C++ doesnt have
properties which you set Readonly like VB.net (I couldnt find it in
Borland C++) and wondered if these were VB ideas?

I believe Properties in C++ is a custom add-on of Borland. If you want
readonly properties you'll have to implement that feature I think. (but I
don't use C++ very much so I can't be sure).
 
john andrew said:
I kind of see C++ as the OOP (defacto) standard .

When I think of early OOP languages, I think of SmallTalk.
I've never used it, but did do some reading about it....

LFS
 
john andrew said:
When using properties with OOP, VB6 had Get/Let and VB.net has
Readonly/and
...

Are theses OOP concepts with Property use or only specific to Visual Basic
properties,

With this property use does C++ have this as well or just Visual C++.?

Notice that properties are sort of (very valuable and useful) syntactic
sugar. In Java people are using 'get' and 'set' methods instead of
properties, and one could archieve a read-only property by simply not
implementing a "setter". That's similar in other programming languages that
don't provide high-level syntactical support for implementing attributes.

Managed C++ provides support for properties with the '__property' keyword.
It's possible to write read-only properties too by only writing a
'__property Bla get_MyBla'.
 
john andrew said:
Anyway I was actually refering to the fact that C++ doesnt have properties
which you set Readonly like VB.net (I couldnt find it in Borland C++) and
wondered if these were VB ideas?

I kind of see C++ as the OOP (defacto) standard .

Huh?!

In theory, there is a set of OO features, and many OO languages provide only
a small subset of these features (VB.NET, C#, Java, ... provide PIE
(Polymorphism, Inheritance, Encapsulation) support, VB6 didn't do that out
of the box (we are speaking VB6 being an object-based programming language
instead of being an object-oriented programming language, although there was
rudimentary support for OO). So, C++ is not /the only/ OO language that
demonstrates /all possible/ OO features.
 
John,
Huh? (to the entire thread).

As Herfried states: Properties are simply syntactic sugar to accessor
methods. The concept of encapsulating access (accessor methods) is a major
tenant (concept) of OO.

The .NET Framework (C#, VB.NET, Managed C++) support properties just as VB6
did. The specific syntax for declaring the property may change slightly
between the languages, however you access them the same in all the
languages, you access them as you would a field...

Other platforms, such as Java & J#, use get/set accessor methods. Which
means you need to use method invocation syntax to use them. This also means
that J# although a .NET language requires you to use the underlying get/set
method that the property creates...


Assume you have a Person class with a "Name" property in a .NET, you can
use:

aPerson.Name = "Jay"
value = aPerson.Name

While in Java a Person class with "Name" accessor methods you would use:

aPerson.setName("Jay")
value = aPerson.getName()

If you look at the IL, the .NET code actually generates calls that look like
the Java! Syntactic sugar!

The following section of MSDN identifies Language Equivalents

http://msdn.microsoft.com/library/d...us/vsintro7/html/vxgrfLanguageEquivalents.asp

I don't see that it discusses Properties specifically.

Hope this helps
Jay
 
Get and Set are accessor methods that are provided for Read/Write
properties. Removing the Get accessor will render the property a
Write-Only property and removing the Set will make it a ReadOnly
property.

with regards,


J.V.Ravichandran
- http://www.geocities.com/
jvravichandran
- http://www.411asp.net/func/search?
qry=Ravichandran+J.V.&cob=aspnetpro
- http://www.southasianoutlook.com
- http://www.MSDNAA.Net
- http://www.csharphelp.com
- http://www.poetry.com/Publications/
display.asp?ID=P3966388&BN=999&PN=2
- Or, just search on "J.V.Ravichandran"
at http://www.Google.com
 
Back
Top