473,465 Members | 1,846 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

OOP vb.net


--
hello

I have been having a look at the OOP of VB.net and experimenting. I here a
lot of VB.net is a complete new language etc......much harder to understand.

I think I have the major concepts of a windows app but let me know if I am
totally missing the idea of VB.net

I know Java,C so it VB.net didnt seem too foreign

OOP concepts new (or better developed than VB6) in VB.net are inheritance,
encapsulation, polymorphism, constructs, as well as properties
(readonly..),methods. The Implementation classes,objects are similar to VB6
but you have more functionality and flexibility on what you can do in VB.net.

Many Keywords used in VB.net require you to use the relevant import before
they can be used.....like Java because of .Net set up

Can build libraries, controls
You can also use references,controls like vb6

I am missing something. They need to make your program OOP is up to you, but
I like classes which is not new to vb.net. I like OOP and used it in VB6.

Have I got the main idea of vb.net.... (I like it but I see a lot of work
is needed to fully use all the language because it seems so big...but vb6 is
big to)

Making your program OOP is a matter of design and we all have different
views on what is good OOP. This is a side issue to VB.net however I do notice
a lot of sloppy OOP code being implemented (eg functions that returns value
as well as other changesto the data) in VB.net books for the sake of trying
to be more OOP but I will argue that another day.

I think the best way for me to know VB.net is try not to be so complicated
with the language and dont overdo OOP concepts for the sake of it


Nov 21 '05 #1
7 1310
I have done a few posts here lately and I promise I will cut back!

"john andrew" wrote:

--
hello

I have been having a look at the OOP of VB.net and experimenting. I here a
lot of VB.net is a complete new language etc......much harder to understand.

I think I have the major concepts of a windows app but let me know if I am
totally missing the idea of VB.net

I know Java,C so it VB.net didnt seem too foreign

OOP concepts new (or better developed than VB6) in VB.net are inheritance,
encapsulation, polymorphism, constructs, as well as properties
(readonly..),methods. The Implementation classes,objects are similar to VB6
but you have more functionality and flexibility on what you can do in VB.net.

Many Keywords used in VB.net require you to use the relevant import before
they can be used.....like Java because of .Net set up

Can build libraries, controls
You can also use references,controls like vb6

I am missing something. They need to make your program OOP is up to you, but
I like classes which is not new to vb.net. I like OOP and used it in VB6.

Have I got the main idea of vb.net.... (I like it but I see a lot of work
is needed to fully use all the language because it seems so big...but vb6 is
big to)

Making your program OOP is a matter of design and we all have different
views on what is good OOP. This is a side issue to VB.net however I do notice
a lot of sloppy OOP code being implemented (eg functions that returns value
as well as other changesto the data) in VB.net books for the sake of trying
to be more OOP but I will argue that another day.

I think the best way for me to know VB.net is try not to be so complicated
with the language and dont overdo OOP concepts for the sake of it

Nov 21 '05 #2
John,

Just start and try to do some things in an other way as you probably was
used too.

And as most simple thing to start, "Try to avoid global variables"

Therefore not
\\\
Private i as integer
Private myfield() as string
Private mytempfield as string
Private sub mysub()
for i = 0 to 9
mytempfield = "A" & CStr(i)
redim preserve myfield(i)
myfield(i) = mytempfield
next
end sub
///
However something as
\\\
Private function mysub() as arraylist
dim myarrlist as new arraylist
for i = 0 to 9
dim sb as new text.stringbuilder
sb.add("A")
sb.add(i.tostring)
myarrlist.add(sb.tostring)
next
return myarrlist
///
The stringbuilder part is not often done in this way; however, it is for
this sample. It is by the way as it is showed in this way the most
efficient. While as it was "A" & "B" would be slower, that has to do with
constants. However, forget that for now.

What happens is that there is all the time an "sb" object new created from
the class stringbuilder and that its reference is freed every time in the
loop. Add the end of the function the arraylist stays on the managed heap,
which is the place for all objects, because there is a reference too it,
while all the stringbuilders will be deleted by the Garbage collector (GC)
from the managed heap because they have no references anymore and are not
referenced as well.

You think maybe coming from classic programming that this is inefficient,
yes exactly in OOP programming is a little bit inefficiency, however you get
it back by better too maintenance programs and easier reuse of code.

Starting it in this way, wills in my opinion lead you in a while to the
point that you start building your own classes, using inheriting,
overloading and/or whatever.

I hope that this gives some ideas?

Cor

Nov 21 '05 #3
"john andrew" <jo********@discussions.microsoft.com> schrieb:
I have been having a look at the OOP of VB.net and experimenting. I here a
lot of VB.net is a complete new language etc......much harder to
understand.
The language itself is not much harder to understand. It's OOP that people
have to learn. If you are good in Java programming and know OO concepts,
switching to VB.NET is easy.
OOP concepts new (or better developed than VB6) in VB.net are inheritance,
encapsulation, polymorphism, constructs, as well as properties
(readonly..),methods.
Readonly properties were also available in VB6, in a much more convenient
way (different levels of accessibility for the 'Get' and 'Let' part of the
property).
Many Keywords used in VB.net require you to use the relevant import before
they can be used.....like Java because of .Net set up
Many classes require importing the namespace they are part of. Keywords
don't need 'Imports'.
I am missing something. They need to make your program OOP is up to you,
but
I like classes which is not new to vb.net. I like OOP and used it in VB6.
Yes, it's (and that's an advantage of VB over C#) still up to you to write
an OO program or a simple procedural program. Nevertheless, OO features of
VB.NET are much more powerful than they were in VB Classic. Parameterized
constructors, type safety, overloading, built-in implelementation
inheritance, ...
Making your program OOP is a matter of design and we all have different
views on what is good OOP. This is a side issue to VB.net however I do
notice
a lot of sloppy OOP code being implemented (eg functions that returns
value
Why do you think that a function that returns a value is bad OOP code?!
I think the best way for me to know VB.net is try not to be so complicated
with the language and dont overdo OOP concepts for the sake of it


That's true, OOP is not always the best solution. OO currently is a "hype".

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Nov 21 '05 #4

"john andrew" <jo********@discussions.microsoft.com> wrote
Can build libraries, controls
You can also use references,controls like vb6

I am missing something.


In addition to the standard Windows applications, you get a much farther
reach in .Net:

Console applications
Mobile (Pocket PC type) applications
ASP (Web) applications
Web Services
And you can even include user scripting in your applications.
(all using the SAME VB.Net syntax, of course!)

In a nutshell, we used VB syntax to learn the VB language.
In .Net we use VB-like syntax to interact with the FCL.
(Framework Class Library). All languages use the same
set of classes from the FCL. (Largely equalizing performance
issues) While VB would compile to P-code or Native code,
..Net languages compile to MSIL (Intermediate Language).
(Another equalizing factor) Anyone can look at the IL using
ILDASM.EXE. (Oh well!)

While VB used COM and the Registry to share components,
..Net uses meta-data in each assembly to find and load any other
needed files (with support for sharing common files and for COM
when needed....) VB was reference counted, and dependant on
proper tear down, .Net uses a garbage collector to free memory.

At a more basic level, VB was from the desktop era, while
the .Net platform is targeted more toward network applications.
You can use the same IDE and language to write both the client
and server side code....

HTH
LFS

Nov 21 '05 #5
Herfried,
Making your program OOP is a matter of design and we all have different
views on what is good OOP. This is a side issue to VB.net however I do
notice
a lot of sloppy OOP code being implemented (eg functions that returns
value
Why do you think that a function that returns a value is bad OOP code?!


You need to look at his entire statement:
... (eg functions that returns value as well as other changesto the data) ...


The "as well as other changes to the data" is known as a side effect. I hope
you agree that Side effects can be bad. Which is why I say that Functions
should not have ByRef parameters...

Hope this helps
Jay
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:%2****************@tk2msftngp13.phx.gbl... "john andrew" <jo********@discussions.microsoft.com> schrieb:
I have been having a look at the OOP of VB.net and experimenting. I here
a
lot of VB.net is a complete new language etc......much harder to
understand.


The language itself is not much harder to understand. It's OOP that
people have to learn. If you are good in Java programming and know OO
concepts, switching to VB.NET is easy.
OOP concepts new (or better developed than VB6) in VB.net are
inheritance,
encapsulation, polymorphism, constructs, as well as properties
(readonly..),methods.


Readonly properties were also available in VB6, in a much more convenient
way (different levels of accessibility for the 'Get' and 'Let' part of the
property).
Many Keywords used in VB.net require you to use the relevant import
before
they can be used.....like Java because of .Net set up


Many classes require importing the namespace they are part of. Keywords
don't need 'Imports'.
I am missing something. They need to make your program OOP is up to you,
but
I like classes which is not new to vb.net. I like OOP and used it in VB6.


Yes, it's (and that's an advantage of VB over C#) still up to you to write
an OO program or a simple procedural program. Nevertheless, OO features
of VB.NET are much more powerful than they were in VB Classic.
Parameterized constructors, type safety, overloading, built-in
implelementation inheritance, ...
Making your program OOP is a matter of design and we all have different
views on what is good OOP. This is a side issue to VB.net however I do
notice
a lot of sloppy OOP code being implemented (eg functions that returns
value


Why do you think that a function that returns a value is bad OOP code?!
I think the best way for me to know VB.net is try not to be so
complicated
with the language and dont overdo OOP concepts for the sake of it


That's true, OOP is not always the best solution. OO currently is a
"hype".

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #6
Jay,

"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> schrieb:
You need to look at his entire statement:
... (eg functions that returns value as well as other changesto the data) ...


The "as well as other changes to the data" is known as a side effect. I
hope you agree that Side effects can be bad. Which is why I say that
Functions should not have ByRef parameters...


OK, I misread the text :-). I thought that the OP wanted to give two
samples of bad practices that were not related to each other. Thank you for
making me aware that I was wrong.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Nov 21 '05 #7
Herfried,
OK, I misread the text :-). I thought that the OP wanted to give two
samples of bad practices that were not related to each other. I hope he doesn't!
Thank you for making me aware that I was wrong. I would not say you were wrong as much as we took two different
interpretations of his statement...

Jay

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl... Jay,

"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> schrieb:
You need to look at his entire statement:
... (eg functions that returns value

as well as other changesto the data) ...


The "as well as other changes to the data" is known as a side effect. I
hope you agree that Side effects can be bad. Which is why I say that
Functions should not have ByRef parameters...


OK, I misread the text :-). I thought that the OP wanted to give two
samples of bad practices that were not related to each other. Thank you
for making me aware that I was wrong.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: William C. White | last post by:
Does anyone know of a way to use PHP /w Authorize.net AIM without using cURL? Our website is hosted on a shared drive and the webhost company doesn't installed additional software (such as cURL)...
2
by: Albert Ahtenberg | last post by:
Hello, I don't know if it is only me but I was sure that header("Location:url") redirects the browser instantly to URL, or at least stops the execution of the code. But appearantely it continues...
3
by: James | last post by:
Hi, I have a form with 2 fields. 'A' 'B' The user completes one of the fields and the form is submitted. On the results page I want to run a query, but this will change subject to which...
0
by: Ollivier Robert | last post by:
Hello, I'm trying to link PHP with Oracle 9.2.0/OCI8 with gcc 3.2.3 on a Solaris9 system. The link succeeds but everytime I try to run php, I get a SEGV from inside the libcnltsh.so library. ...
1
by: Richard Galli | last post by:
I want viewers to compare state laws on a single subject. Imagine a three-column table with a drop-down box on the top. A viewer selects a state from the list, and that state's text fills the...
4
by: Albert Ahtenberg | last post by:
Hello, I have two questions. 1. When the user presses the back button and returns to a form he filled the form is reseted. How do I leave there the values he inserted? 2. When the...
1
by: inderjit S Gabrie | last post by:
Hi all Here is the scenerio ...is it possibly to do this... i am getting valid course dates output on to a web which i have designed ....all is okay so far , look at the following web url ...
2
by: Jack | last post by:
Hi All, What is the PHP equivilent of Oracle bind variables in a SQL statement, e.g. select x from y where z=:parameter Which in asp/jsp would be followed by some statements to bind a value...
3
by: Sandwick | last post by:
I am trying to change the size of a drawing so they are all 3x3. the script below is what i was trying to use to cut it in half ... I get errors. I can display the normal picture but not the...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.