Connecting Tech Pros Worldwide Help | Site Map

class design question

rodchar
Guest
 
Posts: n/a
#1: Nov 18 '05
Hey all,

I'm trying to understand Master/Detail concepts in VB.NET. If I do a data
adapter fill for both customer and orders from Northwind where should that
dataset live?

What client is responsible for instantiating the orders class? Would it be
the ui layer or the master class in the business layer?

thanks,
rodchar
Kevin Spencer
Guest
 
Posts: n/a
#2: Nov 18 '05

re: class design question


Your question seems to mix business and interface logic in a way that makes
it impossible to easily answer. For example, the phrase "Master/Detail" is
referring to User Interface design, not business class design. but your
first question is actually about using a DataSet, which is a business class.

Your second question ("What client is responsible for instantiating the
order class?") makes even less sense to me. What kind of "client" are you
referring to? That is, what sense or definition of the word "client" are you
trying to apply? You seem to define "client" as being a "layer" of an
application, but that's a new one on me. And what is this "master class" you
refer to? For that matter, what is the "orders class?"

I will take a stab at helping you out, although I can't understand or
therefore answer your questions. First of all, forget about VB.Net. In
Mexico I would ask where "el bano" is. In the U.S., where we speak English,
I would ask where the bathroom is. However, regardless of the language, I
would be asking the same thing. This isn't a VB.Net issue, it's a
design/architecture issue.

The Master/Detail concept is a UI concept, in which a set of data is
displayed, and details about individual members of that set of data are
displayed separately, but in a connected way. For example, clicking a row in
a DataGrid might display the details about the record selected in another
DataGrid or UI object of some kind. The data might be from the same data
source, or different. All that is required is that the data sources are
related, such as orders that are grouped by customer. There can be a single
data source for both interfaces, or 2 related data sources.

Note that the talk so far has all been about UI, not business. The UI should
be loosely coupled with the business objects it works with. Loose coupling
is one of the key elements of n-tiered architecture. How you structure your
business objects is pretty much up to you, and dependent upon the
circumstances/requirements of your app. You just need to keep your mind on
the principles, and the rest should fall into place.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living

"rodchar" <rodchar@discussions.microsoft.com> wrote in message
news:826DA29D-FAB0-46EB-B415-7730C63E26BF@microsoft.com...[color=blue]
> Hey all,
>
> I'm trying to understand Master/Detail concepts in VB.NET. If I do a data
> adapter fill for both customer and orders from Northwind where should that
> dataset live?
>
> What client is responsible for instantiating the orders class? Would it be
> the ui layer or the master class in the business layer?
>
> thanks,
> rodchar[/color]


rodchar
Guest
 
Posts: n/a
#3: Nov 18 '05

re: class design question


I apologize for the confusion, I'm just taking the Northwind database to help
relay my questions, so I'm using the Customers and Orders table as my
master/detail relationship.

Regarding instantiating the Orders class I was wondering where does "Dim o
as new Orders" occur. Will it occur in a method in the Customers class or
would it occur in WebForm1.aspx.

Regarding the dataset, where should "Dim ds as NEW dataset" occur?
My dataset has the Customers and Orders table in it. I want to load both
tables at the start of the application. What happens when the Orders class
gets instantiated, how would it get to the data in the dataset? If I
instantiate the dataset in the Customers class then I guess I need to make
the dataset public so the Orders object can get to it? Or is there another
way?

Sorry if I'm being confusing again,
rodchar

"Kevin Spencer" wrote:
[color=blue]
> Your question seems to mix business and interface logic in a way that makes
> it impossible to easily answer. For example, the phrase "Master/Detail" is
> referring to User Interface design, not business class design. but your
> first question is actually about using a DataSet, which is a business class.
>
> Your second question ("What client is responsible for instantiating the
> order class?") makes even less sense to me. What kind of "client" are you
> referring to? That is, what sense or definition of the word "client" are you
> trying to apply? You seem to define "client" as being a "layer" of an
> application, but that's a new one on me. And what is this "master class" you
> refer to? For that matter, what is the "orders class?"
>
> I will take a stab at helping you out, although I can't understand or
> therefore answer your questions. First of all, forget about VB.Net. In
> Mexico I would ask where "el bano" is. In the U.S., where we speak English,
> I would ask where the bathroom is. However, regardless of the language, I
> would be asking the same thing. This isn't a VB.Net issue, it's a
> design/architecture issue.
>
> The Master/Detail concept is a UI concept, in which a set of data is
> displayed, and details about individual members of that set of data are
> displayed separately, but in a connected way. For example, clicking a row in
> a DataGrid might display the details about the record selected in another
> DataGrid or UI object of some kind. The data might be from the same data
> source, or different. All that is required is that the data sources are
> related, such as orders that are grouped by customer. There can be a single
> data source for both interfaces, or 2 related data sources.
>
> Note that the talk so far has all been about UI, not business. The UI should
> be loosely coupled with the business objects it works with. Loose coupling
> is one of the key elements of n-tiered architecture. How you structure your
> business objects is pretty much up to you, and dependent upon the
> circumstances/requirements of your app. You just need to keep your mind on
> the principles, and the rest should fall into place.
>
> --
> HTH,
> Kevin Spencer
> ..Net Developer
> Microsoft MVP
> I get paid good money to
> solve puzzles for a living
>
> "rodchar" <rodchar@discussions.microsoft.com> wrote in message
> news:826DA29D-FAB0-46EB-B415-7730C63E26BF@microsoft.com...[color=green]
> > Hey all,
> >
> > I'm trying to understand Master/Detail concepts in VB.NET. If I do a data
> > adapter fill for both customer and orders from Northwind where should that
> > dataset live?
> >
> > What client is responsible for instantiating the orders class? Would it be
> > the ui layer or the master class in the business layer?
> >
> > thanks,
> > rodchar[/color]
>
>
>[/color]
Kevin Spencer
Guest
 
Posts: n/a
#4: Nov 18 '05

re: class design question


It's okay, rodchar. I'm just having a hard time figuring out what you're
asying, and how to help.

For example:
[color=blue]
> Regarding instantiating the Orders class I was wondering where does "Dim o
> as new Orders" occur. Will it occur in a method in the Customers class or
> would it occur in WebForm1.aspx.[/color]

You've lost me already. I am not aware of any existing class named "Orders."
Neither am I aware of any existing class named "Customers." So, I'm at a
loss. Where are you getting these class names from?

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living

"rodchar" <rodchar@discussions.microsoft.com> wrote in message
news:93CD93FD-8A97-4177-9D78-D80B27DF072F@microsoft.com...[color=blue]
> I apologize for the confusion, I'm just taking the Northwind database to[/color]
help[color=blue]
> relay my questions, so I'm using the Customers and Orders table as my
> master/detail relationship.
>
> Regarding instantiating the Orders class I was wondering where does "Dim o
> as new Orders" occur. Will it occur in a method in the Customers class or
> would it occur in WebForm1.aspx.
>
> Regarding the dataset, where should "Dim ds as NEW dataset" occur?
> My dataset has the Customers and Orders table in it. I want to load both
> tables at the start of the application. What happens when the Orders class
> gets instantiated, how would it get to the data in the dataset? If I
> instantiate the dataset in the Customers class then I guess I need to make
> the dataset public so the Orders object can get to it? Or is there another
> way?
>
> Sorry if I'm being confusing again,
> rodchar
>
> "Kevin Spencer" wrote:
>[color=green]
> > Your question seems to mix business and interface logic in a way that[/color][/color]
makes[color=blue][color=green]
> > it impossible to easily answer. For example, the phrase "Master/Detail"[/color][/color]
is[color=blue][color=green]
> > referring to User Interface design, not business class design. but your
> > first question is actually about using a DataSet, which is a business[/color][/color]
class.[color=blue][color=green]
> >
> > Your second question ("What client is responsible for instantiating the
> > order class?") makes even less sense to me. What kind of "client" are[/color][/color]
you[color=blue][color=green]
> > referring to? That is, what sense or definition of the word "client" are[/color][/color]
you[color=blue][color=green]
> > trying to apply? You seem to define "client" as being a "layer" of an
> > application, but that's a new one on me. And what is this "master class"[/color][/color]
you[color=blue][color=green]
> > refer to? For that matter, what is the "orders class?"
> >
> > I will take a stab at helping you out, although I can't understand or
> > therefore answer your questions. First of all, forget about VB.Net. In
> > Mexico I would ask where "el bano" is. In the U.S., where we speak[/color][/color]
English,[color=blue][color=green]
> > I would ask where the bathroom is. However, regardless of the language,[/color][/color]
I[color=blue][color=green]
> > would be asking the same thing. This isn't a VB.Net issue, it's a
> > design/architecture issue.
> >
> > The Master/Detail concept is a UI concept, in which a set of data is
> > displayed, and details about individual members of that set of data are
> > displayed separately, but in a connected way. For example, clicking a[/color][/color]
row in[color=blue][color=green]
> > a DataGrid might display the details about the record selected in[/color][/color]
another[color=blue][color=green]
> > DataGrid or UI object of some kind. The data might be from the same data
> > source, or different. All that is required is that the data sources are
> > related, such as orders that are grouped by customer. There can be a[/color][/color]
single[color=blue][color=green]
> > data source for both interfaces, or 2 related data sources.
> >
> > Note that the talk so far has all been about UI, not business. The UI[/color][/color]
should[color=blue][color=green]
> > be loosely coupled with the business objects it works with. Loose[/color][/color]
coupling[color=blue][color=green]
> > is one of the key elements of n-tiered architecture. How you structure[/color][/color]
your[color=blue][color=green]
> > business objects is pretty much up to you, and dependent upon the
> > circumstances/requirements of your app. You just need to keep your mind[/color][/color]
on[color=blue][color=green]
> > the principles, and the rest should fall into place.
> >
> > --
> > HTH,
> > Kevin Spencer
> > ..Net Developer
> > Microsoft MVP
> > I get paid good money to
> > solve puzzles for a living
> >
> > "rodchar" <rodchar@discussions.microsoft.com> wrote in message
> > news:826DA29D-FAB0-46EB-B415-7730C63E26BF@microsoft.com...[color=darkred]
> > > Hey all,
> > >
> > > I'm trying to understand Master/Detail concepts in VB.NET. If I do a[/color][/color][/color]
data[color=blue][color=green][color=darkred]
> > > adapter fill for both customer and orders from Northwind where should[/color][/color][/color]
that[color=blue][color=green][color=darkred]
> > > dataset live?
> > >
> > > What client is responsible for instantiating the orders class? Would[/color][/color][/color]
it be[color=blue][color=green][color=darkred]
> > > the ui layer or the master class in the business layer?
> > >
> > > thanks,
> > > rodchar[/color]
> >
> >
> >[/color][/color]


rodchar
Guest
 
Posts: n/a
#5: Nov 18 '05

re: class design question


I'm using these tables in a sample asp.net application i created. i've read
that in class design to make your classes from real entities so Customer and
Orders are classes I came up with.

"Kevin Spencer" wrote:
[color=blue]
> It's okay, rodchar. I'm just having a hard time figuring out what you're
> asying, and how to help.
>
> For example:
>[color=green]
> > Regarding instantiating the Orders class I was wondering where does "Dim o
> > as new Orders" occur. Will it occur in a method in the Customers class or
> > would it occur in WebForm1.aspx.[/color]
>
> You've lost me already. I am not aware of any existing class named "Orders."
> Neither am I aware of any existing class named "Customers." So, I'm at a
> loss. Where are you getting these class names from?
>
> --
> HTH,
> Kevin Spencer
> ..Net Developer
> Microsoft MVP
> I get paid good money to
> solve puzzles for a living
>
> "rodchar" <rodchar@discussions.microsoft.com> wrote in message
> news:93CD93FD-8A97-4177-9D78-D80B27DF072F@microsoft.com...[color=green]
> > I apologize for the confusion, I'm just taking the Northwind database to[/color]
> help[color=green]
> > relay my questions, so I'm using the Customers and Orders table as my
> > master/detail relationship.
> >
> > Regarding instantiating the Orders class I was wondering where does "Dim o
> > as new Orders" occur. Will it occur in a method in the Customers class or
> > would it occur in WebForm1.aspx.
> >
> > Regarding the dataset, where should "Dim ds as NEW dataset" occur?
> > My dataset has the Customers and Orders table in it. I want to load both
> > tables at the start of the application. What happens when the Orders class
> > gets instantiated, how would it get to the data in the dataset? If I
> > instantiate the dataset in the Customers class then I guess I need to make
> > the dataset public so the Orders object can get to it? Or is there another
> > way?
> >
> > Sorry if I'm being confusing again,
> > rodchar
> >
> > "Kevin Spencer" wrote:
> >[color=darkred]
> > > Your question seems to mix business and interface logic in a way that[/color][/color]
> makes[color=green][color=darkred]
> > > it impossible to easily answer. For example, the phrase "Master/Detail"[/color][/color]
> is[color=green][color=darkred]
> > > referring to User Interface design, not business class design. but your
> > > first question is actually about using a DataSet, which is a business[/color][/color]
> class.[color=green][color=darkred]
> > >
> > > Your second question ("What client is responsible for instantiating the
> > > order class?") makes even less sense to me. What kind of "client" are[/color][/color]
> you[color=green][color=darkred]
> > > referring to? That is, what sense or definition of the word "client" are[/color][/color]
> you[color=green][color=darkred]
> > > trying to apply? You seem to define "client" as being a "layer" of an
> > > application, but that's a new one on me. And what is this "master class"[/color][/color]
> you[color=green][color=darkred]
> > > refer to? For that matter, what is the "orders class?"
> > >
> > > I will take a stab at helping you out, although I can't understand or
> > > therefore answer your questions. First of all, forget about VB.Net. In
> > > Mexico I would ask where "el bano" is. In the U.S., where we speak[/color][/color]
> English,[color=green][color=darkred]
> > > I would ask where the bathroom is. However, regardless of the language,[/color][/color]
> I[color=green][color=darkred]
> > > would be asking the same thing. This isn't a VB.Net issue, it's a
> > > design/architecture issue.
> > >
> > > The Master/Detail concept is a UI concept, in which a set of data is
> > > displayed, and details about individual members of that set of data are
> > > displayed separately, but in a connected way. For example, clicking a[/color][/color]
> row in[color=green][color=darkred]
> > > a DataGrid might display the details about the record selected in[/color][/color]
> another[color=green][color=darkred]
> > > DataGrid or UI object of some kind. The data might be from the same data
> > > source, or different. All that is required is that the data sources are
> > > related, such as orders that are grouped by customer. There can be a[/color][/color]
> single[color=green][color=darkred]
> > > data source for both interfaces, or 2 related data sources.
> > >
> > > Note that the talk so far has all been about UI, not business. The UI[/color][/color]
> should[color=green][color=darkred]
> > > be loosely coupled with the business objects it works with. Loose[/color][/color]
> coupling[color=green][color=darkred]
> > > is one of the key elements of n-tiered architecture. How you structure[/color][/color]
> your[color=green][color=darkred]
> > > business objects is pretty much up to you, and dependent upon the
> > > circumstances/requirements of your app. You just need to keep your mind[/color][/color]
> on[color=green][color=darkred]
> > > the principles, and the rest should fall into place.
> > >
> > > --
> > > HTH,
> > > Kevin Spencer
> > > ..Net Developer
> > > Microsoft MVP
> > > I get paid good money to
> > > solve puzzles for a living
> > >
> > > "rodchar" <rodchar@discussions.microsoft.com> wrote in message
> > > news:826DA29D-FAB0-46EB-B415-7730C63E26BF@microsoft.com...
> > > > Hey all,
> > > >
> > > > I'm trying to understand Master/Detail concepts in VB.NET. If I do a[/color][/color]
> data[color=green][color=darkred]
> > > > adapter fill for both customer and orders from Northwind where should[/color][/color]
> that[color=green][color=darkred]
> > > > dataset live?
> > > >
> > > > What client is responsible for instantiating the orders class? Would[/color][/color]
> it be[color=green][color=darkred]
> > > > the ui layer or the master class in the business layer?
> > > >
> > > > thanks,
> > > > rodchar
> > >
> > >
> > >[/color][/color]
>
>
>[/color]
Kevin Spencer
Guest
 
Posts: n/a
#6: Nov 18 '05

re: class design question


I think we need to back up some here, rodchar, and here's why: Your question
involves a number of concepts, none of which you seem to have a very good
grasp on. Uncle Chutney sez "Big things are made up of lots of little
things." An application is made up of lots of classes. Classes are made up
of lots of fields, propreties and functions (somewhat simplified). Fields,
properties and functions are made up of lots of statements and expressions.
So, before you can ask the question "where does "Dim o as new Orders"
occur," you have to have a firm understanding of classes. In order to know
anything about classes, you need a firm understanding of object-orientation,
fields, properties, and functions. And in order to know anything about
fields, properties, and functions, you have to have a firm understanding of
expressions and statements.

In the world of programming, when you learn a new technology, you generally
start out with a simple program called "Hello World." All it does is output
the phrase "Hello World" to whatever output mechanism the technology uses.
It takes no input. It simply puts out "Hello World." There is a reason for
this (Big things are made up of lots of little things). By getting a firm
grasp of the bricks, the house appears without even thinking about it. How
do you write an elephant? One byte at a time.

I would suggest rather than making up your own self-tutorial, find some very
basic ready-made ones that you can use (the .Net SDK is full of them), and
do them. Study each one to get a full understanding of it. Once you've
mastered the concepts, move on to something that does a little more. You can
download the .Net SDK from the following URL (for free!):

http://www.microsoft.com/downloads/d...displaylang=en

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living


"rodchar" <rodchar@discussions.microsoft.com> wrote in message
news:5157D8A6-B497-4712-A092-8FFF87ED3D62@microsoft.com...[color=blue]
> I'm using these tables in a sample asp.net application i created. i've[/color]
read[color=blue]
> that in class design to make your classes from real entities so Customer[/color]
and[color=blue]
> Orders are classes I came up with.
>
> "Kevin Spencer" wrote:
>[color=green]
> > It's okay, rodchar. I'm just having a hard time figuring out what you're
> > asying, and how to help.
> >
> > For example:
> >[color=darkred]
> > > Regarding instantiating the Orders class I was wondering where does[/color][/color][/color]
"Dim o[color=blue][color=green][color=darkred]
> > > as new Orders" occur. Will it occur in a method in the Customers class[/color][/color][/color]
or[color=blue][color=green][color=darkred]
> > > would it occur in WebForm1.aspx.[/color]
> >
> > You've lost me already. I am not aware of any existing class named[/color][/color]
"Orders."[color=blue][color=green]
> > Neither am I aware of any existing class named "Customers." So, I'm at a
> > loss. Where are you getting these class names from?
> >
> > --
> > HTH,
> > Kevin Spencer
> > ..Net Developer
> > Microsoft MVP
> > I get paid good money to
> > solve puzzles for a living
> >
> > "rodchar" <rodchar@discussions.microsoft.com> wrote in message
> > news:93CD93FD-8A97-4177-9D78-D80B27DF072F@microsoft.com...[color=darkred]
> > > I apologize for the confusion, I'm just taking the Northwind database[/color][/color][/color]
to[color=blue][color=green]
> > help[color=darkred]
> > > relay my questions, so I'm using the Customers and Orders table as my
> > > master/detail relationship.
> > >
> > > Regarding instantiating the Orders class I was wondering where does[/color][/color][/color]
"Dim o[color=blue][color=green][color=darkred]
> > > as new Orders" occur. Will it occur in a method in the Customers class[/color][/color][/color]
or[color=blue][color=green][color=darkred]
> > > would it occur in WebForm1.aspx.
> > >
> > > Regarding the dataset, where should "Dim ds as NEW dataset" occur?
> > > My dataset has the Customers and Orders table in it. I want to load[/color][/color][/color]
both[color=blue][color=green][color=darkred]
> > > tables at the start of the application. What happens when the Orders[/color][/color][/color]
class[color=blue][color=green][color=darkred]
> > > gets instantiated, how would it get to the data in the dataset? If I
> > > instantiate the dataset in the Customers class then I guess I need to[/color][/color][/color]
make[color=blue][color=green][color=darkred]
> > > the dataset public so the Orders object can get to it? Or is there[/color][/color][/color]
another[color=blue][color=green][color=darkred]
> > > way?
> > >
> > > Sorry if I'm being confusing again,
> > > rodchar
> > >
> > > "Kevin Spencer" wrote:
> > >
> > > > Your question seems to mix business and interface logic in a way[/color][/color][/color]
that[color=blue][color=green]
> > makes[color=darkred]
> > > > it impossible to easily answer. For example, the phrase[/color][/color][/color]
"Master/Detail"[color=blue][color=green]
> > is[color=darkred]
> > > > referring to User Interface design, not business class design. but[/color][/color][/color]
your[color=blue][color=green][color=darkred]
> > > > first question is actually about using a DataSet, which is a[/color][/color][/color]
business[color=blue][color=green]
> > class.[color=darkred]
> > > >
> > > > Your second question ("What client is responsible for instantiating[/color][/color][/color]
the[color=blue][color=green][color=darkred]
> > > > order class?") makes even less sense to me. What kind of "client"[/color][/color][/color]
are[color=blue][color=green]
> > you[color=darkred]
> > > > referring to? That is, what sense or definition of the word "client"[/color][/color][/color]
are[color=blue][color=green]
> > you[color=darkred]
> > > > trying to apply? You seem to define "client" as being a "layer" of[/color][/color][/color]
an[color=blue][color=green][color=darkred]
> > > > application, but that's a new one on me. And what is this "master[/color][/color][/color]
class"[color=blue][color=green]
> > you[color=darkred]
> > > > refer to? For that matter, what is the "orders class?"
> > > >
> > > > I will take a stab at helping you out, although I can't understand[/color][/color][/color]
or[color=blue][color=green][color=darkred]
> > > > therefore answer your questions. First of all, forget about VB.Net.[/color][/color][/color]
In[color=blue][color=green][color=darkred]
> > > > Mexico I would ask where "el bano" is. In the U.S., where we speak[/color]
> > English,[color=darkred]
> > > > I would ask where the bathroom is. However, regardless of the[/color][/color][/color]
language,[color=blue][color=green]
> > I[color=darkred]
> > > > would be asking the same thing. This isn't a VB.Net issue, it's a
> > > > design/architecture issue.
> > > >
> > > > The Master/Detail concept is a UI concept, in which a set of data is
> > > > displayed, and details about individual members of that set of data[/color][/color][/color]
are[color=blue][color=green][color=darkred]
> > > > displayed separately, but in a connected way. For example, clicking[/color][/color][/color]
a[color=blue][color=green]
> > row in[color=darkred]
> > > > a DataGrid might display the details about the record selected in[/color]
> > another[color=darkred]
> > > > DataGrid or UI object of some kind. The data might be from the same[/color][/color][/color]
data[color=blue][color=green][color=darkred]
> > > > source, or different. All that is required is that the data sources[/color][/color][/color]
are[color=blue][color=green][color=darkred]
> > > > related, such as orders that are grouped by customer. There can be a[/color]
> > single[color=darkred]
> > > > data source for both interfaces, or 2 related data sources.
> > > >
> > > > Note that the talk so far has all been about UI, not business. The[/color][/color][/color]
UI[color=blue][color=green]
> > should[color=darkred]
> > > > be loosely coupled with the business objects it works with. Loose[/color]
> > coupling[color=darkred]
> > > > is one of the key elements of n-tiered architecture. How you[/color][/color][/color]
structure[color=blue][color=green]
> > your[color=darkred]
> > > > business objects is pretty much up to you, and dependent upon the
> > > > circumstances/requirements of your app. You just need to keep your[/color][/color][/color]
mind[color=blue][color=green]
> > on[color=darkred]
> > > > the principles, and the rest should fall into place.
> > > >
> > > > --
> > > > HTH,
> > > > Kevin Spencer
> > > > ..Net Developer
> > > > Microsoft MVP
> > > > I get paid good money to
> > > > solve puzzles for a living
> > > >
> > > > "rodchar" <rodchar@discussions.microsoft.com> wrote in message
> > > > news:826DA29D-FAB0-46EB-B415-7730C63E26BF@microsoft.com...
> > > > > Hey all,
> > > > >
> > > > > I'm trying to understand Master/Detail concepts in VB.NET. If I do[/color][/color][/color]
a[color=blue][color=green]
> > data[color=darkred]
> > > > > adapter fill for both customer and orders from Northwind where[/color][/color][/color]
should[color=blue][color=green]
> > that[color=darkred]
> > > > > dataset live?
> > > > >
> > > > > What client is responsible for instantiating the orders class?[/color][/color][/color]
Would[color=blue][color=green]
> > it be[color=darkred]
> > > > > the ui layer or the master class in the business layer?
> > > > >
> > > > > thanks,
> > > > > rodchar
> > > >
> > > >
> > > >[/color]
> >
> >
> >[/color][/color]


rodchar
Guest
 
Posts: n/a
#7: Nov 18 '05

re: class design question


10-4. Thanks.

"Kevin Spencer" wrote:
[color=blue]
> I think we need to back up some here, rodchar, and here's why: Your question
> involves a number of concepts, none of which you seem to have a very good
> grasp on. Uncle Chutney sez "Big things are made up of lots of little
> things." An application is made up of lots of classes. Classes are made up
> of lots of fields, propreties and functions (somewhat simplified). Fields,
> properties and functions are made up of lots of statements and expressions.
> So, before you can ask the question "where does "Dim o as new Orders"
> occur," you have to have a firm understanding of classes. In order to know
> anything about classes, you need a firm understanding of object-orientation,
> fields, properties, and functions. And in order to know anything about
> fields, properties, and functions, you have to have a firm understanding of
> expressions and statements.
>
> In the world of programming, when you learn a new technology, you generally
> start out with a simple program called "Hello World." All it does is output
> the phrase "Hello World" to whatever output mechanism the technology uses.
> It takes no input. It simply puts out "Hello World." There is a reason for
> this (Big things are made up of lots of little things). By getting a firm
> grasp of the bricks, the house appears without even thinking about it. How
> do you write an elephant? One byte at a time.
>
> I would suggest rather than making up your own self-tutorial, find some very
> basic ready-made ones that you can use (the .Net SDK is full of them), and
> do them. Study each one to get a full understanding of it. Once you've
> mastered the concepts, move on to something that does a little more. You can
> download the .Net SDK from the following URL (for free!):
>
> http://www.microsoft.com/downloads/d...displaylang=en
>
> --
> HTH,
> Kevin Spencer
> ..Net Developer
> Microsoft MVP
> I get paid good money to
> solve puzzles for a living
>
>
> "rodchar" <rodchar@discussions.microsoft.com> wrote in message
> news:5157D8A6-B497-4712-A092-8FFF87ED3D62@microsoft.com...[color=green]
> > I'm using these tables in a sample asp.net application i created. i've[/color]
> read[color=green]
> > that in class design to make your classes from real entities so Customer[/color]
> and[color=green]
> > Orders are classes I came up with.
> >
> > "Kevin Spencer" wrote:
> >[color=darkred]
> > > It's okay, rodchar. I'm just having a hard time figuring out what you're
> > > asying, and how to help.
> > >
> > > For example:
> > >
> > > > Regarding instantiating the Orders class I was wondering where does[/color][/color]
> "Dim o[color=green][color=darkred]
> > > > as new Orders" occur. Will it occur in a method in the Customers class[/color][/color]
> or[color=green][color=darkred]
> > > > would it occur in WebForm1.aspx.
> > >
> > > You've lost me already. I am not aware of any existing class named[/color][/color]
> "Orders."[color=green][color=darkred]
> > > Neither am I aware of any existing class named "Customers." So, I'm at a
> > > loss. Where are you getting these class names from?
> > >
> > > --
> > > HTH,
> > > Kevin Spencer
> > > ..Net Developer
> > > Microsoft MVP
> > > I get paid good money to
> > > solve puzzles for a living
> > >
> > > "rodchar" <rodchar@discussions.microsoft.com> wrote in message
> > > news:93CD93FD-8A97-4177-9D78-D80B27DF072F@microsoft.com...
> > > > I apologize for the confusion, I'm just taking the Northwind database[/color][/color]
> to[color=green][color=darkred]
> > > help
> > > > relay my questions, so I'm using the Customers and Orders table as my
> > > > master/detail relationship.
> > > >
> > > > Regarding instantiating the Orders class I was wondering where does[/color][/color]
> "Dim o[color=green][color=darkred]
> > > > as new Orders" occur. Will it occur in a method in the Customers class[/color][/color]
> or[color=green][color=darkred]
> > > > would it occur in WebForm1.aspx.
> > > >
> > > > Regarding the dataset, where should "Dim ds as NEW dataset" occur?
> > > > My dataset has the Customers and Orders table in it. I want to load[/color][/color]
> both[color=green][color=darkred]
> > > > tables at the start of the application. What happens when the Orders[/color][/color]
> class[color=green][color=darkred]
> > > > gets instantiated, how would it get to the data in the dataset? If I
> > > > instantiate the dataset in the Customers class then I guess I need to[/color][/color]
> make[color=green][color=darkred]
> > > > the dataset public so the Orders object can get to it? Or is there[/color][/color]
> another[color=green][color=darkred]
> > > > way?
> > > >
> > > > Sorry if I'm being confusing again,
> > > > rodchar
> > > >
> > > > "Kevin Spencer" wrote:
> > > >
> > > > > Your question seems to mix business and interface logic in a way[/color][/color]
> that[color=green][color=darkred]
> > > makes
> > > > > it impossible to easily answer. For example, the phrase[/color][/color]
> "Master/Detail"[color=green][color=darkred]
> > > is
> > > > > referring to User Interface design, not business class design. but[/color][/color]
> your[color=green][color=darkred]
> > > > > first question is actually about using a DataSet, which is a[/color][/color]
> business[color=green][color=darkred]
> > > class.
> > > > >
> > > > > Your second question ("What client is responsible for instantiating[/color][/color]
> the[color=green][color=darkred]
> > > > > order class?") makes even less sense to me. What kind of "client"[/color][/color]
> are[color=green][color=darkred]
> > > you
> > > > > referring to? That is, what sense or definition of the word "client"[/color][/color]
> are[color=green][color=darkred]
> > > you
> > > > > trying to apply? You seem to define "client" as being a "layer" of[/color][/color]
> an[color=green][color=darkred]
> > > > > application, but that's a new one on me. And what is this "master[/color][/color]
> class"[color=green][color=darkred]
> > > you
> > > > > refer to? For that matter, what is the "orders class?"
> > > > >
> > > > > I will take a stab at helping you out, although I can't understand[/color][/color]
> or[color=green][color=darkred]
> > > > > therefore answer your questions. First of all, forget about VB.Net.[/color][/color]
> In[color=green][color=darkred]
> > > > > Mexico I would ask where "el bano" is. In the U.S., where we speak
> > > English,
> > > > > I would ask where the bathroom is. However, regardless of the[/color][/color]
> language,[color=green][color=darkred]
> > > I
> > > > > would be asking the same thing. This isn't a VB.Net issue, it's a
> > > > > design/architecture issue.
> > > > >
> > > > > The Master/Detail concept is a UI concept, in which a set of data is
> > > > > displayed, and details about individual members of that set of data[/color][/color]
> are[color=green][color=darkred]
> > > > > displayed separately, but in a connected way. For example, clicking[/color][/color]
> a[color=green][color=darkred]
> > > row in
> > > > > a DataGrid might display the details about the record selected in
> > > another
> > > > > DataGrid or UI object of some kind. The data might be from the same[/color][/color]
> data[color=green][color=darkred]
> > > > > source, or different. All that is required is that the data sources[/color][/color]
> are[color=green][color=darkred]
> > > > > related, such as orders that are grouped by customer. There can be a
> > > single
> > > > > data source for both interfaces, or 2 related data sources.
> > > > >
> > > > > Note that the talk so far has all been about UI, not business. The[/color][/color]
> UI[color=green][color=darkred]
> > > should
> > > > > be loosely coupled with the business objects it works with. Loose
> > > coupling
> > > > > is one of the key elements of n-tiered architecture. How you[/color][/color]
> structure[color=green][color=darkred]
> > > your
> > > > > business objects is pretty much up to you, and dependent upon the
> > > > > circumstances/requirements of your app. You just need to keep your[/color][/color]
> mind[color=green][color=darkred]
> > > on
> > > > > the principles, and the rest should fall into place.
> > > > >
> > > > > --
> > > > > HTH,
> > > > > Kevin Spencer
> > > > > ..Net Developer
> > > > > Microsoft MVP
> > > > > I get paid good money to
> > > > > solve puzzles for a living
> > > > >
> > > > > "rodchar" <rodchar@discussions.microsoft.com> wrote in message
> > > > > news:826DA29D-FAB0-46EB-B415-7730C63E26BF@microsoft.com...
> > > > > > Hey all,
> > > > > >
> > > > > > I'm trying to understand Master/Detail concepts in VB.NET. If I do[/color][/color]
> a[color=green][color=darkred]
> > > data
> > > > > > adapter fill for both customer and orders from Northwind where[/color][/color]
> should[color=green][color=darkred]
> > > that
> > > > > > dataset live?
> > > > > >
> > > > > > What client is responsible for instantiating the orders class?[/color][/color]
> Would[color=green][color=darkred]
> > > it be
> > > > > > the ui layer or the master class in the business layer?
> > > > > >
> > > > > > thanks,
> > > > > > rodchar
> > > > >
> > > > >
> > > > >
> > >
> > >
> > >[/color][/color]
>
>
>[/color]
Closed Thread


Similar ASP.NET bytes