473,804 Members | 2,195 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Need help understanding OOPs terminology

Hey guys, need some help understanding some things that maybe someone can
explain or clarify it a little better then a text book. Here is my
understanding so far:

Class - basically a shell for your code

Fields - basically just a variable but can be "write protected"

Properties - access fields, they can retrieve data contained in the
"variable"

Methods - Used for calculations, or can retrieve data from objects such as
combo boxes and text
fields, methods can also start sub procedures or another set of
instructions.

Constructors - special method that runs that runs and can assign a new value
to fields

Am I close on any of these?? Thanks guys!!

Mike
Jul 21 '05 #1
2 1845
"Mike" <mi**@work.co m> wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
You're close on all of them, I've just redone it for you emphasizing the
similarities between the various components.

Class - A "template" for objects. Best analogy for this: the class is the
cookie cutter and the objects are the cookies.
Members - Something defined on a class. Basically these make up the "shape"
of the cookie cutter. All members have a visibility (public, private, etc)
Field - A type of member that is a variable with class scope. Fields can be
readonly, which means they can only be set at object creation.
Method - A type of member that contains executable code. They can be divided
into two main types: functions (which return values) and procedures (which
do not).
Property - A type of member that has similar usage semantics as fields do.
Unlike fields, properties do not allow direct access to the underlying
variable, but control access to it through one or both of two special case
methods: the get and set accessors. The get accessor is a function, and the
set accessor is a procedure.
Constructor - A type of member that is effectively a method. It is used to
construct the object. It is the only method that can modify readonly fields.
Jul 21 '05 #2
Thanks Sean that helps!

I found a pretty good (a little surprised) white paper on creating classes
in VB.NET.

It took 7 pages to describe what and how to use classes whereas the book I
have only took 4!

Thanks again!!

Mike
"Sean Hederman" <em*******@codi ngsanity.blogsp ot.com> wrote in message
news:d4******** **@ctb-nnrp2.saix.net. ..
"Mike" <mi**@work.co m> wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
You're close on all of them, I've just redone it for you emphasizing the
similarities between the various components.

Class - A "template" for objects. Best analogy for this: the class is the
cookie cutter and the objects are the cookies.
Members - Something defined on a class. Basically these make up the
"shape" of the cookie cutter. All members have a visibility (public,
private, etc)
Field - A type of member that is a variable with class scope. Fields can
be readonly, which means they can only be set at object creation.
Method - A type of member that contains executable code. They can be
divided into two main types: functions (which return values) and
procedures (which do not).
Property - A type of member that has similar usage semantics as fields do.
Unlike fields, properties do not allow direct access to the underlying
variable, but control access to it through one or both of two special case
methods: the get and set accessors. The get accessor is a function, and
the set accessor is a procedure.
Constructor - A type of member that is effectively a method. It is used to
construct the object. It is the only method that can modify readonly
fields.

Jul 21 '05 #3

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

Similar topics

21
2997
by: Chris Reedy | last post by:
For everyone - Apologies for the length of this message. If you don't want to look at the long example, you can skip to the end of the message. And for the Python gurus among you, if you can spare the time, I would appreciate any comments (including words like evil and disgusting, if you think they are applicable :-}) on the example here. Kenny -
15
2394
by: Roy Smith | last post by:
I understand that "delete xp" deletes a scalar object and "delete xp" deletes an array of objects, but what I don't understand is why you need to tell the compiler which you're doing. When you do "delete xp", the delete procedure (not sure if that's the right terminology) obviously knows how many objects were allocated by the corresponding "new" call. So, why can't it just know whether you did "new x" or "new x"?
3
1475
by: Newbie | last post by:
I am extremely new to the working of XML. Our client wants us to access their Website. They also want us to retrieve XML (files?) from their site. We will then somehow import it into our SQL database where we do our own thing with our custom software and then send it back to the client via XML again. My question is..what do I need to set up in terms of hardware and software to be able to download the XML files into my environment. ...
2
2482
by: O.R.Senthil Kumaran | last post by:
Hi list: Following is a piece of code: main(int argc, char** argv) { int rc, result; struct passwd *uidpwent; /* init resources */
0
1018
by: Tiga | last post by:
Right off I know nothing about programming so any help will be useful. We have an application that I have manipulated by creating an IF statement which is below. {|@Functions.@ValidatedPrompt()|Enter Config ID,dbo.vw_AssetA,Validation,A_ConfigID} This creates a dialogue box that prompts the user to enter a numeric value which is then queried against the database tables to return all records with that value.
2
288
by: Mike | last post by:
Hey guys, need some help understanding some things that maybe someone can explain or clarify it a little better then a text book. Here is my understanding so far: Class - basically a shell for your code Fields - basically just a variable but can be "write protected" Properties - access fields, they can retrieve data contained in the "variable"
1
1473
by: Learner | last post by:
Hi there, I have designed a three tier arichitecture(presentation, business and datalayer). I have used Shared keyword in all my DL methods inorder to make them available in my BL. I have realized that i don't need to instantiate the Data class in my BL and could use all DL methods in my BL with out instantiating the Data class. But in my BL i haven't used the Shared keyword in any of the methods. So i need to instantiate the BL in my...
15
4650
by: Cheryl Langdon | last post by:
Hello everyone, This is my first attempt at getting help in this manner. Please forgive me if this is an inappropriate request. I suddenly find myself in urgent need of instruction on how to communicate with a MySQL database table on a web server, from inside of my company's Access-VBA application. I know VBA pretty well but have never before needed to do this HTTP/XML/MySQL type functions.
15
1676
by: silverburgh.meryl | last post by:
Hi, I am trying to understand the following line: # a is an integer array max(), (j,i)) Can you please tell me what that means, I think sum(a means find the some from a to a But what is the meaning of the part (j,i)?
0
9715
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9595
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10600
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10097
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9175
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5535
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5673
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4313
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3002
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.