473,405 Members | 2,354 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,405 software developers and data experts.

Procedure question

et
I am new to asp.net. I am writing a program that will revolve around an
extensive client database, and wonder what the best way to design the
program is, using classes. I have about 10 different sections, or
categories if you will, about a client. For instance, some clients have
data regarding our Estate Planning section, some clients have data regarding
our Real Estate section, etc. Would it be better to have one object that
potentially can contain all data about one client, or better to have many
different objects for each section? The only time we would need every field
for a client is when we're doing reports, most of the program is getting
data in and out for the users. Is this a judgment call? Wouldn't one
object containing everything be quite large, or can I instantiate it with
only the as needed properties each time it's instantiated. But for
maintenance purposes it might be better to have one object. And maybe this
isn't even the best idea, at all.

Thanks for all advice.
Feb 22 '06 #1
2 1220
Hi et,

From your question I can see that you are thinking clearly and asking the
right kinds of questions. This is good; it will prevent you from having to
go back and fix a lot of stuff that doesn't work correctly because you spent
some time up front planning. Those who fail to plan, plan to fail! ;-)

I can also see that your understanding of OOP (Object-Oriented Programming)
is somewhat murky, and that is where you need to begin. I have compiled
several links that will help you gain a better understanding, and therefore,
be able to plan your object model more easily, and with better structure:

http://msdn.microsoft.com/library/de...ithObjects.asp
While this is aimed at VB.Net users, the concepts are the same for any OOP
programming language.

http://www.aonaware.com/OOP1.htm
A very simplified, but easy to understand introduction to OOP.

http://java.sun.com/docs/books/tutor...pts/index.html
While this is aimed at Java users, the concepts are the same for any OOP
programming language. In addition, .Net resembles Java in many ways.

http://en.wikipedia.org/wiki/Object-...ed_programming
Very good but somewhat "technical" article, with lots of external links and
references.

A few words to kick you off: OOP is all about organization. It is also all
about abstraction. One of the main ideas of OOP is to think of programming
"things" as "real-world" things. I can see that you have something of an
idea of this. For example, note your use of the word "clients." You speak of
many different *types* of clients, but they are all "clients." Does this
suggest something to you? It should. You use the same word to describe many
different types of real-world entities because they all share some of the
same properties, or attributes. A class is not an object; it is a *type*.
The difference is that an object is a thing, but a type is an idea about a
thing, or a group of things. It is like a definition of the properties that
define what a "type" of a thing is.

For example, you might think of one of Plato's favorite analogies: a chair.
Now, there are many different types of chairs, but they are all chairs. What
do they have in common? The answer is not as simple as you might think.

So, you have a bunch of "clients." That's a good starting point. Now, they
share some things, and don't share others. Within the overall group, you can
create sub-groups of clients that share different types of things. Now, this
is where inheritance and/or interfaces come into play. Inheritance in OOP is
much like inheritance in the real world, but much simpler. It might be
better to stick to chairs. All chairs are chairs, but some are made of wood,
and some are made of metal. So, you could inherit "chair" and create "wooden
chair" and "metal chair." Now you can create many different types of both
wooden and metal chairs, and of course, you can keep sub-dividing them into
more and more categories.

Okay, getting back to clients: Some are Estate clients, some are Real Estate
clients, etc. And Estate Clients would have a set of properties that pertain
to Estates, while Real Estate clients would have a different set of
properties. But some clients might be both, or several of the types of
clients. However, a Real Estate client will always have a certain set of
"Real Estate properties," and an Estate client will always have a certain
set of "Estate properties." And these clients will belong to a number of
differnent categories.

Now, if you were designing a database, you would create a client table, a
Real Estate table, and an Estate table. Each of these 2 tables would have a
"Client ID" column which would identify which clients used that particular
service. There would be a one-to-many relationship between the client table
and each of these "Service" tables. Each client would only have 1 "Service"
record, but each "Service" would have many related client records.

So, as we continue to think about it, notice that I have started referring
to "Services." Sounds like they might have something in common, too. So, we
now have a base "client" class and a base "Service" class. From the
"Service" class we can derive "Real Estate Service," "Estate Service," and
so on. Each "Service" instance would have a Collection of clients, the
people who subscribe to that service. You could call it "Clients" or
"Subscribers." Again, there would be one "client" per client, but
potentially many "Services," so, the "Client" class could have a collection
of "Service" classes. This would represent all the Services used by that
client. Since each "Service" inherits "Service," it would be able to go into
that collection. And since each type of "client" inherits "client" a Service
could have many different types of "clients" in its "Clients" Collection.

I hope that this stimulates your thinking and helps youto get moving in the
right direction. It is brief, but I expect you will read up on the other
resources I posted as well.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
To a tea you esteem
a hurting back as a wallet.
"et" <ea*************@yahoo.com> wrote in message
news:%2***************@tk2msftngp13.phx.gbl...
I am new to asp.net. I am writing a program that will revolve around an
extensive client database, and wonder what the best way to design the
program is, using classes. I have about 10 different sections, or
categories if you will, about a client. For instance, some clients have
data regarding our Estate Planning section, some clients have data
regarding our Real Estate section, etc. Would it be better to have one
object that potentially can contain all data about one client, or better to
have many different objects for each section? The only time we would need
every field for a client is when we're doing reports, most of the program
is getting data in and out for the users. Is this a judgment call?
Wouldn't one object containing everything be quite large, or can I
instantiate it with only the as needed properties each time it's
instantiated. But for maintenance purposes it might be better to have one
object. And maybe this isn't even the best idea, at all.

Thanks for all advice.

Feb 22 '06 #2
et
Boy, definitely! It has really stimulated my thinking, and I will be
eagerly reading the articles you recommended. Thanks very much, you have
been supremely helpful.

"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:%2*****************@tk2msftngp13.phx.gbl...
Hi et,

From your question I can see that you are thinking clearly and asking the
right kinds of questions. This is good; it will prevent you from having to
go back and fix a lot of stuff that doesn't work correctly because you
spent some time up front planning. Those who fail to plan, plan to fail!
;-)

I can also see that your understanding of OOP (Object-Oriented
Programming) is somewhat murky, and that is where you need to begin. I
have compiled several links that will help you gain a better
understanding, and therefore, be able to plan your object model more
easily, and with better structure:

http://msdn.microsoft.com/library/de...ithObjects.asp
While this is aimed at VB.Net users, the concepts are the same for any OOP
programming language.

http://www.aonaware.com/OOP1.htm
A very simplified, but easy to understand introduction to OOP.

http://java.sun.com/docs/books/tutor...pts/index.html
While this is aimed at Java users, the concepts are the same for any OOP
programming language. In addition, .Net resembles Java in many ways.

http://en.wikipedia.org/wiki/Object-...ed_programming
Very good but somewhat "technical" article, with lots of external links
and references.

A few words to kick you off: OOP is all about organization. It is also all
about abstraction. One of the main ideas of OOP is to think of programming
"things" as "real-world" things. I can see that you have something of an
idea of this. For example, note your use of the word "clients." You speak
of many different *types* of clients, but they are all "clients." Does
this suggest something to you? It should. You use the same word to
describe many different types of real-world entities because they all
share some of the same properties, or attributes. A class is not an
object; it is a *type*. The difference is that an object is a thing, but a
type is an idea about a thing, or a group of things. It is like a
definition of the properties that define what a "type" of a thing is.

For example, you might think of one of Plato's favorite analogies: a
chair. Now, there are many different types of chairs, but they are all
chairs. What do they have in common? The answer is not as simple as you
might think.

So, you have a bunch of "clients." That's a good starting point. Now, they
share some things, and don't share others. Within the overall group, you
can create sub-groups of clients that share different types of things.
Now, this is where inheritance and/or interfaces come into play.
Inheritance in OOP is much like inheritance in the real world, but much
simpler. It might be better to stick to chairs. All chairs are chairs, but
some are made of wood, and some are made of metal. So, you could inherit
"chair" and create "wooden chair" and "metal chair." Now you can create
many different types of both wooden and metal chairs, and of course, you
can keep sub-dividing them into more and more categories.

Okay, getting back to clients: Some are Estate clients, some are Real
Estate clients, etc. And Estate Clients would have a set of properties
that pertain to Estates, while Real Estate clients would have a different
set of properties. But some clients might be both, or several of the types
of clients. However, a Real Estate client will always have a certain set
of "Real Estate properties," and an Estate client will always have a
certain set of "Estate properties." And these clients will belong to a
number of differnent categories.

Now, if you were designing a database, you would create a client table, a
Real Estate table, and an Estate table. Each of these 2 tables would have
a "Client ID" column which would identify which clients used that
particular service. There would be a one-to-many relationship between the
client table and each of these "Service" tables. Each client would only
have 1 "Service" record, but each "Service" would have many related client
records.

So, as we continue to think about it, notice that I have started referring
to "Services." Sounds like they might have something in common, too. So,
we now have a base "client" class and a base "Service" class. From the
"Service" class we can derive "Real Estate Service," "Estate Service," and
so on. Each "Service" instance would have a Collection of clients, the
people who subscribe to that service. You could call it "Clients" or
"Subscribers." Again, there would be one "client" per client, but
potentially many "Services," so, the "Client" class could have a
collection of "Service" classes. This would represent all the Services
used by that client. Since each "Service" inherits "Service," it would be
able to go into that collection. And since each type of "client" inherits
"client" a Service could have many different types of "clients" in its
"Clients" Collection.

I hope that this stimulates your thinking and helps youto get moving in
the right direction. It is brief, but I expect you will read up on the
other resources I posted as well.

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
To a tea you esteem
a hurting back as a wallet.
"et" <ea*************@yahoo.com> wrote in message
news:%2***************@tk2msftngp13.phx.gbl...
I am new to asp.net. I am writing a program that will revolve around an
extensive client database, and wonder what the best way to design the
program is, using classes. I have about 10 different sections, or
categories if you will, about a client. For instance, some clients have
data regarding our Estate Planning section, some clients have data
regarding our Real Estate section, etc. Would it be better to have one
object that potentially can contain all data about one client, or better
to have many different objects for each section? The only time we would
need every field for a client is when we're doing reports, most of the
program is getting data in and out for the users. Is this a judgment
call? Wouldn't one object containing everything be quite large, or can I
instantiate it with only the as needed properties each time it's
instantiated. But for maintenance purposes it might be better to have one
object. And maybe this isn't even the best idea, at all.

Thanks for all advice.


Feb 22 '06 #3

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

Similar topics

5
by: Lauren Quantrell | last post by:
Just wondering if this is good form: Alter Procedure "mySPName" @UniqueID int AS set nocount on set xact_abort off DELETE FROM tblNameOne
1
by: Raquel | last post by:
Have a question on the Stored procedure method code generated by DB2 development center for Java stored procedures. Suppose I have a requirement to return the resultset consisting of FIRSTNME,...
8
by: Thomasb | last post by:
With a background in MS SQL Server programming I'm used to temporary tables. Have just started to work with DB2 ver 7 on z/OS and stumbled into the concept of GLOBAL TEMPORARY TABLE. I have...
2
by: singlal | last post by:
Hi, my question was not getting any attention because it moved to 2nd page; so posting it again. Sorry for any inconvenience but I need to get it resolved fast. Need your help! ...
7
by: Siv | last post by:
Hi, I have a stored procedure that I want to execute and then wait in a loop showing a timer whilst it completes and then carry on once I get notification that it has completed. The main reason...
3
by: Joseph Lu | last post by:
Hi, all I have a stored procedure created in SQL Server like the following lines. // stored proceudre code starts here CREATE PROCEDURE sp_insertdata @strdata varchar(250) , @rsult BIT...
5
by: ric_deez | last post by:
Hi there, I would like to create a simple search form to allow users to search for a job number based on a number of parameters. I think I understand how to use parameteres associated with Stored...
4
by: Henrik Juul | last post by:
How do I call my Stored Procedure recursively: CREATE PROCEDURE dbo.GetParentIONode ( @IONodeID int, @FullNodeAddress char(100) OUTPUT ) AS BEGIN
5
by: william.david.anderson | last post by:
Hi there, I have a newbie question regarding stored procedures and locking. I'm trying to use a stored procedure to perform a 'select for update' and return a cursor. Below is a stripped down...
11
by: peter | last post by:
I am trying to get a SQL stored procedure to use user maintained MQT implicitly which raises questions on when they are used or not used. In theory you would expect the stored procedure to pick up...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
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
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
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...

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.