473,382 Members | 1,526 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Structure declaration - use of structure

Newbie to donnet

This is an example of a structure given in vs.net help

============================
Private Structure Employee
Public GivenName As String ' This employee's given name.
Public FamilyName As String ' This employee's family name.
Public Extension As Long ' This employee's telephone extension.
Private Salary As Decimal ' This employee's annual salary.
Public Sub GiveRaise(Raise As Double) ' Raise this employee's
salary.
Salary *= Raise
End Sub
Public Event ReviewTime() ' This employee must be reviewed.
End Structure
============================
(I come from database application backgroud.)

The example given above stores emplyee information. Why bother storing
employee information in a structure if you are going to later put into
a database anyway. Why not just put it directly into a database. Or is
the example above just an impractical example?

Can someone give me an example for the use of a structures that
illustrates what its advantages are.
Nov 22 '05 #1
3 2699
Why put things in a structure when they could be perfectly stored in a
database? Because simply a database is not available everywhere.

Say you were to write a webservice that gives you back an arraylist of
employees. The webservice is called by an ASP.NET page, which then renders
to a browser; maybe even a WAP browser on a Pocket PC. Even though you could
possibly have a SQL Server running there; you could not guarantee access to
it, you could not guarantee it's existence, not to mention you cannot
guarantee every pocket pc with a pocket dba to maintain that sql server.

It's just an alternate representation of the data to make it more portable.
Another word for this is "Business objects", so Employee structure could be
a business object, customer/order/address etc. could be other business
objects. And these have the ability to live on their own, and describe
themselves completely without relying on any other entity. Many of these can
be serialized and sent from one end of the wire to another; like star trek
transporter even. Or some of these can be shallow serialized like the movie
Matrix (proxy stays on one machine and the stub acts on another machine; one
dies the other croaks too). The main theme being, they can do all this
without any setup, or need for any additional software. Certainly not a
heavy duty s/w like a RDBMS.

Hella exciting stuff man .. welcome to programming :). Further reading -
Structure Vs. Class in .NET.

- Sahil Malik
You can reach me thru my blog http://www.dotnetjunkies.com/weblog/sahilmalik

"Douglas Buchanan" <db*********@hotmail.com> wrote in message
news:72**************************@posting.google.c om...
Newbie to donnet

This is an example of a structure given in vs.net help

============================
Private Structure Employee
Public GivenName As String ' This employee's given name.
Public FamilyName As String ' This employee's family name.
Public Extension As Long ' This employee's telephone extension.
Private Salary As Decimal ' This employee's annual salary.
Public Sub GiveRaise(Raise As Double) ' Raise this employee's
salary.
Salary *= Raise
End Sub
Public Event ReviewTime() ' This employee must be reviewed.
End Structure
============================
(I come from database application backgroud.)

The example given above stores emplyee information. Why bother storing
employee information in a structure if you are going to later put into
a database anyway. Why not just put it directly into a database. Or is
the example above just an impractical example?

Can someone give me an example for the use of a structures that
illustrates what its advantages are.

Nov 22 '05 #2
Sahil,

Thank you for the very thorough answer.

"Sahil Malik" <co*****************@nospam.com> wrote in message news:<uH**************@TK2MSFTNGP14.phx.gbl>...
Why put things in a structure when they could be perfectly stored in a
database? Because simply a database is not available everywhere.

Say you were to write a webservice that gives you back an arraylist of
employees. The webservice is called by an ASP.NET page, which then renders
to a browser; maybe even a WAP browser on a Pocket PC. Even though you could
possibly have a SQL Server running there; you could not guarantee access to
it, you could not guarantee it's existence, not to mention you cannot
guarantee every pocket pc with a pocket dba to maintain that sql server.

It's just an alternate representation of the data to make it more portable.
Another word for this is "Business objects", so Employee structure could be
a business object, customer/order/address etc. could be other business
objects. And these have the ability to live on their own, and describe
themselves completely without relying on any other entity. Many of these can
be serialized and sent from one end of the wire to another; like star trek
transporter even. Or some of these can be shallow serialized like the movie
Matrix (proxy stays on one machine and the stub acts on another machine; one
dies the other croaks too). The main theme being, they can do all this
without any setup, or need for any additional software. Certainly not a
heavy duty s/w like a RDBMS.

Hella exciting stuff man .. welcome to programming :). Further reading -
Structure Vs. Class in .NET.

- Sahil Malik
You can reach me thru my blog http://www.dotnetjunkies.com/weblog/sahilmalik

"Douglas Buchanan" <db*********@hotmail.com> wrote in message
news:72**************************@posting.google.c om...
Newbie to donnet

This is an example of a structure given in vs.net help

============================
Private Structure Employee
Public GivenName As String ' This employee's given name.
Public FamilyName As String ' This employee's family name.
Public Extension As Long ' This employee's telephone extension.
Private Salary As Decimal ' This employee's annual salary.
Public Sub GiveRaise(Raise As Double) ' Raise this employee's
salary.
Salary *= Raise
End Sub
Public Event ReviewTime() ' This employee must be reviewed.
End Structure
============================
(I come from database application backgroud.)

The example given above stores emplyee information. Why bother storing
employee information in a structure if you are going to later put into
a database anyway. Why not just put it directly into a database. Or is
the example above just an impractical example?

Can someone give me an example for the use of a structures that
illustrates what its advantages are.

Nov 22 '05 #3
You're welcome :)
- Sahil Malik
You can reach me thru my blog at
http://www.dotnetjunkies.com/weblog/sahilmalik
"Douglas Buchanan" <db*********@hotmail.com> wrote in message
news:72**************************@posting.google.c om...
Sahil,

Thank you for the very thorough answer.

"Sahil Malik" <co*****************@nospam.com> wrote in message

news:<uH**************@TK2MSFTNGP14.phx.gbl>...
Why put things in a structure when they could be perfectly stored in a
database? Because simply a database is not available everywhere.

Say you were to write a webservice that gives you back an arraylist of
employees. The webservice is called by an ASP.NET page, which then renders to a browser; maybe even a WAP browser on a Pocket PC. Even though you could possibly have a SQL Server running there; you could not guarantee access to it, you could not guarantee it's existence, not to mention you cannot
guarantee every pocket pc with a pocket dba to maintain that sql server.

It's just an alternate representation of the data to make it more portable. Another word for this is "Business objects", so Employee structure could be a business object, customer/order/address etc. could be other business
objects. And these have the ability to live on their own, and describe
themselves completely without relying on any other entity. Many of these can be serialized and sent from one end of the wire to another; like star trek transporter even. Or some of these can be shallow serialized like the movie Matrix (proxy stays on one machine and the stub acts on another machine; one dies the other croaks too). The main theme being, they can do all this
without any setup, or need for any additional software. Certainly not a
heavy duty s/w like a RDBMS.

Hella exciting stuff man .. welcome to programming :). Further reading -
Structure Vs. Class in .NET.

- Sahil Malik
You can reach me thru my blog http://www.dotnetjunkies.com/weblog/sahilmalik


"Douglas Buchanan" <db*********@hotmail.com> wrote in message
news:72**************************@posting.google.c om...
Newbie to donnet

This is an example of a structure given in vs.net help

============================
Private Structure Employee
Public GivenName As String ' This employee's given name.
Public FamilyName As String ' This employee's family name.
Public Extension As Long ' This employee's telephone extension.
Private Salary As Decimal ' This employee's annual salary.
Public Sub GiveRaise(Raise As Double) ' Raise this employee's
salary.
Salary *= Raise
End Sub
Public Event ReviewTime() ' This employee must be reviewed.
End Structure
============================
(I come from database application backgroud.)

The example given above stores emplyee information. Why bother storing
employee information in a structure if you are going to later put into
a database anyway. Why not just put it directly into a database. Or is
the example above just an impractical example?

Can someone give me an example for the use of a structures that
illustrates what its advantages are.

Nov 22 '05 #4

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

Similar topics

5
by: kazack | last post by:
I am a little confused with code I am looking at. My c++ book does not go into passing a structure to a function so I pulled out a c book which does. and I do not understand the prototype verses...
7
by: Mick | last post by:
Does anyone know how to pass an array of structures to a DLL? Here's what I'm doing... the VB.Net error is at the end. *** C++ Structure Declaration: typedef struct _SOME_STRUCT { char...
13
by: Amarendra | last post by:
Folks, This structure padding issue is bothering me now, could not locate a satisfactory answer on clc, so here it goes... I have a structure, given below: typedef struct { int flag; char...
2
by: kimimaro | last post by:
hi I wonder if array can be work along with structure? Below are the declaration of my structure struct employee{ char ID; char Name; char Department;
6
by: Laurent | last post by:
Hello, This is probably a dumb question, but I just would like to understand how the C# compiler computes the size of the managed structure or classes. I'm working on this class: public...
7
by: Jimakos Bilakis | last post by:
Hi guys! I'm using the C++ Builder 6 Enterprise Edition where I create some tables in Paradox and with the help of a structure i pass my data from the form (Edit boxes) to the Paradox table with...
10
by: David Fort | last post by:
Hi, I'm upgrading a VB6 app to VB.net and I'm having a problem with a call to a function provided in a DLL. The function takes the address of a structure which it will fill in with values. I...
6
by: Aston Martin | last post by:
Hi All, ********************** My Situation ********************** I am working on project that involves passing a structure to unmanaged code from .Net world (well using C#). Perhaps an example...
6
by: Scoots | last post by:
I know the usually applied workaround for multiple definitions of header files, but I have a problem on this one. This time, I can't just ifndef the header file that defines my structure. So...
76
by: jacob navia | last post by:
Since standard C doesn't provide any way for the programmer to direct the compiler as to how to layout structures, most compilers provide some way to do this, albeit in different forms. ...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.