Re: Sharing an instance of an object across classes
Hi, again, sloan.
Thanks for sharing your sample code.
I see a lot of references in the code to business concepts like customers
and orders.
I avoid modeling business objects in source code, because the objects change
at whim. They're owned by the business, after all, not by me. If the
business needs to change something about the attributes or behavior of their
objects, ideally, I'd like them to do it with an administrative application
allowing them to configure the deployed application in a way that meets their
business needs. If they're not up to that, I can make their changes on the
back end myself. The source code doesn't have to change.
It's not that I don't get what you're saying, but the cost of implemeting
business objects in code is too high, in my opinion.
But a lot of other people seem to be doing it, so I guess I can't expect
most people to understand what I'm doing.
Thanks for taking a shot at it, anyways.
-Beth
"sloan" wrote:
Hi, again, sloan.
Thanks for sharing your sample code.
I see a lot of references in the code to business concepts like customers
and orders.
I avoid modeling business objects in source code, because the objects change
at whim. They're owned by the business, after all, not by me. If the
business needs to change something about the attributes or behavior of their
objects, ideally, I'd like them to do it with an administrative application
allowing them to configure the deployed application in a way that meets their
business needs. If they're not up to that, I can make their changes on the
back end myself. The source code doesn't have to change.
It's not that I don't get what you're saying, but the cost of implemeting
business objects in code is too high, in my opinion.
But a lot of other people seem to be doing it, so I guess I can't expect
most people to understand what I'm doing.
Thanks for taking a shot at it, anyways.
-Beth
"sloan" wrote:
//I'm not sure what you mean when you say:
you could learn an awful lot by just taking a day and translating the code
to VB.NET//
>
Take the code sample at the blog entry I provided..and translating it to
VB.NET.
>
>
http://sholliday.space s.live.com/Blog/cns!A68482B9628 A842A!139.entry
The downloadable c# code. There is a "download here" link there.
>
You can do the "2.0" version ... however, timewise the 1.1 version will be
faster to translate.
>
>
>
>
>
"Beth" <Beth@discussio ns.microsoft.co mwrote in message
news:A6BC7C3C-AFBF-4862-A20E-800CA57E8F70@mi crosoft.com...
>
>
>
you could learn an awful lot by just taking a day and translating the code
to VB.NET//
>
Take the code sample at the blog entry I provided..and translating it to
VB.NET.
>
>
http://sholliday.space s.live.com/Blog/cns!A68482B9628 A842A!139.entry
The downloadable c# code. There is a "download here" link there.
>
You can do the "2.0" version ... however, timewise the 1.1 version will be
faster to translate.
>
>
>
>
>
"Beth" <Beth@discussio ns.microsoft.co mwrote in message
news:A6BC7C3C-AFBF-4862-A20E-800CA57E8F70@mi crosoft.com...
Thanks again for replying, sloan.
I keep seeing people using classes to represent business content, like:
public class CustomerDALC
{ public CustomerDALC()
public string CreateCustomer( string name, string address, string city,
string state,
string zip)
which I don't think should be in code because it's outside the
responsibility of the IT department. The business should be able to
change
the structure of their content (by adding a phone field to the customer
table, for example) without affecting any source code, in my opinion.
When they change the structure of a business content table in my
application, the code doesn't change, but I change records in a couple of
tables I created for the purpose of interpreting data in their content
tables.
For some projects, I can hand off the responsibility for maintaining
business content rules to business owners, and they can configure their
app
to meet their business needs as they change over time. I have no interest
in
maintaining their content.
A different approach, I know. Most examples I've seen code business
content
instead of keeping it separate.
I'm not sure what you mean when you say:
you could learn an awful lot by just taking a day and translating the code
to VB.NET
It's already in VB.NET. By 'translating' I'm assuming you mean something
other than changing the naming convention, which I wouldn't learn a whole
lot
from.
Please forgive my ignorance, I'm a little slow.
Oh, and I do intend to use Lists of class types instead of collections to
strengthen the data types. I knew I could do that, just hadn't spent the
time to look up how. Figured I'd meet the business need with collections
first.
Thanks again for your response,
-Beth
"sloan" wrote:
I keep seeing people using classes to represent business content, like:
public class CustomerDALC
{ public CustomerDALC()
public string CreateCustomer( string name, string address, string city,
string state,
string zip)
which I don't think should be in code because it's outside the
responsibility of the IT department. The business should be able to
change
the structure of their content (by adding a phone field to the customer
table, for example) without affecting any source code, in my opinion.
When they change the structure of a business content table in my
application, the code doesn't change, but I change records in a couple of
tables I created for the purpose of interpreting data in their content
tables.
For some projects, I can hand off the responsibility for maintaining
business content rules to business owners, and they can configure their
app
to meet their business needs as they change over time. I have no interest
in
maintaining their content.
A different approach, I know. Most examples I've seen code business
content
instead of keeping it separate.
I'm not sure what you mean when you say:
you could learn an awful lot by just taking a day and translating the code
to VB.NET
It's already in VB.NET. By 'translating' I'm assuming you mean something
other than changing the naming convention, which I wouldn't learn a whole
lot
from.
Please forgive my ignorance, I'm a little slow.
Oh, and I do intend to use Lists of class types instead of collections to
strengthen the data types. I knew I could do that, just hadn't spent the
time to look up how. Figured I'd meet the business need with collections
first.
Thanks again for your response,
-Beth
"sloan" wrote:
>
http://sholliday.space s.live.com/Blog/cns!A68482B9628 A842A!139.entry
>
There is the 1.1 version of my other blog entry I gave you.
I would start there. Move up to the 2.0 version.
(Just read it and step through the code).
The 1.1 version has more explanation than my 2.0 version. So I would
read
(slowly) my 1.1 notes.
>
>
My 1.1 article has some links at the bottom.
>
Both the 1.1 and 2.0 versions of my blog entries have downloadable code.
It
uses the Northwind database.
>
Heck, I think you could learn an awful lot by just taking a day and
translating the code to VB.NET.
But what do I know? I'm a whipper snapper.
>
>
HERE IS THE MOST USEFUL LINK IN THAT COLLECTION:
And a reference to read from start to finish, aka, very informative for a
bird's eye view:
* http://msdn2.microsoft.com/en-us/library/ms978496.aspx
Bookmark it, read it, reread it tomorrow. Reread a month from now.
Reread
it 3 months from now. Reread it 6 months from now.
Reread it every 3 months for the next 2 years.
>
.........
>
At the very least I would create strong(typed) DataSet objects....if you
don't want a full custom class/collection solution.
>
>
Good luck.
>
>
>
>
>
"Beth" <Beth@discussio ns.microsoft.co mwrote in message
news:5313B572-3B67-4DFB-B552-49D057C28B15@mi crosoft.com...
re: you should be doing Layered development
OK, I thought I was, but maybe not.
I have the presentation layer separated from the data access classes,
which
are independent of the business content tables on the database.
I don't have any source code (classes) containing business content,
like
customerID, name, and phone. That's all business content I don't
determine.
I don't hard code that stuff because it's outside of my control and too
volatile.
My classes are dependent on tables in the database I create for my
application's use which are stored in the same database alongside the
business content tables. The content of the tables the source code is
dependent on describe how the application should display, validate,
manage,
and/or exercise data in the business content tables.
I was thinking I 'should' be able to compile my data access classes
into a
separate .dll so I could reuse it for a web front-end. All the data
access
requirements are the same from the presentation layer's point of view.
I don't see a lot of other developers taking this approach, and I see a
lot
of class examples modeling business content, so I don't really expect
many
people to understand what I'm trying to do, which is one reason why
it's
harder for me to get help.
Thanks for trying, anyways.
http://sholliday.space s.live.com/Blog/cns!A68482B9628 A842A!139.entry
>
There is the 1.1 version of my other blog entry I gave you.
I would start there. Move up to the 2.0 version.
(Just read it and step through the code).
The 1.1 version has more explanation than my 2.0 version. So I would
read
(slowly) my 1.1 notes.
>
>
My 1.1 article has some links at the bottom.
>
Both the 1.1 and 2.0 versions of my blog entries have downloadable code.
It
uses the Northwind database.
>
Heck, I think you could learn an awful lot by just taking a day and
translating the code to VB.NET.
But what do I know? I'm a whipper snapper.
>
>
HERE IS THE MOST USEFUL LINK IN THAT COLLECTION:
And a reference to read from start to finish, aka, very informative for a
bird's eye view:
* http://msdn2.microsoft.com/en-us/library/ms978496.aspx
Bookmark it, read it, reread it tomorrow. Reread a month from now.
Reread
it 3 months from now. Reread it 6 months from now.
Reread it every 3 months for the next 2 years.
>
.........
>
At the very least I would create strong(typed) DataSet objects....if you
don't want a full custom class/collection solution.
>
>
Good luck.
>
>
>
>
>
"Beth" <Beth@discussio ns.microsoft.co mwrote in message
news:5313B572-3B67-4DFB-B552-49D057C28B15@mi crosoft.com...
re: you should be doing Layered development
OK, I thought I was, but maybe not.
I have the presentation layer separated from the data access classes,
which
are independent of the business content tables on the database.
I don't have any source code (classes) containing business content,
like
customerID, name, and phone. That's all business content I don't
determine.
I don't hard code that stuff because it's outside of my control and too
volatile.
My classes are dependent on tables in the database I create for my
application's use which are stored in the same database alongside the
business content tables. The content of the tables the source code is
dependent on describe how the application should display, validate,
manage,
and/or exercise data in the business content tables.
I was thinking I 'should' be able to compile my data access classes
into a
separate .dll so I could reuse it for a web front-end. All the data
access
requirements are the same from the presentation layer's point of view.
I don't see a lot of other developers taking this approach, and I see a
lot
of class examples modeling business content, so I don't really expect
many
people to understand what I'm trying to do, which is one reason why
it's
harder for me to get help.
Thanks for trying, anyways.
>
>
Comment