473,394 Members | 1,722 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,394 software developers and data experts.

OO design question...

I am really new to OO design and development pricipals and have a
question...
When developing vb.net applications using OO design principals I have read
where you should be separating the data from the business logic (i.e.
develop data classes AND business classes independantly). So does that mean
that I should really develop a class for each of the tables that I have in
SQL Server and write the appropriate methods to handle the retrieval and
updating etc.. of the data separately from a business class? Then obviously
in the business class, I would instantiate and call data class methods to do
the job...

Does that sounds about right??

Thanks, Brad
Jul 5 '07 #1
5 1263
"Brad Pears" <br***@truenorthloghomes.comwrote in
news:OR**************@TK2MSFTNGP06.phx.gbl:
I am really new to OO design and development pricipals and have a
question...
When developing vb.net applications using OO design principals I have
read where you should be separating the data from the business logic
(i.e. develop data classes AND business classes independantly). So
does that mean that I should really develop a class for each of the
tables that I have in SQL Server and write the appropriate methods to
handle the retrieval and updating etc.. of the data separately from a
business class? Then obviously in the business class, I would
instantiate and call data class methods to do the job...
That sounds like a data layer.

You can avoid writing all that code by using a OR/M mapper like LLBLGen Pro
or Codesmith :-) It's very tedious to write.
Jul 5 '07 #2

"Brad Pears" <br***@truenorthloghomes.comwrote in message
news:OR****************@TK2MSFTNGP06.phx.gbl...
>I am really new to OO design and development pricipals and have a
question...
When developing vb.net applications using OO design principals I have read
where you should be separating the data from the business logic (i.e.
develop data classes AND business classes independantly). So does that
mean that I should really develop a class for each of the tables that I
have in SQL Server and write the appropriate methods to handle the
retrieval and updating etc.. of the data separately from a business class?
Then obviously in the business class, I would instantiate and call data
class methods to do the job...

Does that sounds about right??
Yes, that's correct in the traditional sense. There is also the business
object that persist itself to that database too. The business object has the
database code in it as well, along with the business logic.

Jul 5 '07 #3
//
The business object has the
database code in it as well, along with the business logic.//

That is one way to do it.

Personally I prefer to seperate the code of the business object, and the
code that creates the business object.
One day, you might have different datastores for your objects.
Keeping the 2 ideas seperate gives you more flexibility.

See:
http://sholliday.spaces.live.com/Blog/cns!A68482B9628A842A!139.entry

"Mr. Arnold" <MR. Ar****@Arnold.comwrote in message
news:eB**************@TK2MSFTNGP04.phx.gbl...
>
"Brad Pears" <br***@truenorthloghomes.comwrote in message
news:OR****************@TK2MSFTNGP06.phx.gbl...
I am really new to OO design and development pricipals and have a
question...
When developing vb.net applications using OO design principals I have
read
where you should be separating the data from the business logic (i.e.
develop data classes AND business classes independantly). So does that
mean that I should really develop a class for each of the tables that I
have in SQL Server and write the appropriate methods to handle the
retrieval and updating etc.. of the data separately from a business
class?
Then obviously in the business class, I would instantiate and call data
class methods to do the job...

Does that sounds about right??

Yes, that's correct in the traditional sense. There is also the business
object that persist itself to that database too. The business object has
the
database code in it as well, along with the business logic.

Jul 5 '07 #4
Take a look at
http://msdn.microsoft.com/vstudio/ex.../learningpath/

and look at "windows path" , last lesson 12 thru 16.

Its videos...but he codes one thing one way..and then separates out the
class properly.

When i watched it, i thought it was a good simple example

Miro
"Brad Pears" <br***@truenorthloghomes.comwrote in message
news:OR****************@TK2MSFTNGP06.phx.gbl...
>I am really new to OO design and development pricipals and have a
question...
When developing vb.net applications using OO design principals I have read
where you should be separating the data from the business logic (i.e.
develop data classes AND business classes independantly). So does that
mean that I should really develop a class for each of the tables that I
have in SQL Server and write the appropriate methods to handle the
retrieval and updating etc.. of the data separately from a business class?
Then obviously in the business class, I would instantiate and call data
class methods to do the job...

Does that sounds about right??

Thanks, Brad

Jul 6 '07 #5
Thanks, I'll check it out...

Brad
"Miro" <mi******@golden.netwrote in message
news:e7**************@TK2MSFTNGP02.phx.gbl...
Take a look at
http://msdn.microsoft.com/vstudio/ex.../learningpath/

and look at "windows path" , last lesson 12 thru 16.

Its videos...but he codes one thing one way..and then separates out the
class properly.

When i watched it, i thought it was a good simple example

Miro
"Brad Pears" <br***@truenorthloghomes.comwrote in message
news:OR****************@TK2MSFTNGP06.phx.gbl...
>>I am really new to OO design and development pricipals and have a
question...
When developing vb.net applications using OO design principals I have
read where you should be separating the data from the business logic
(i.e. develop data classes AND business classes independantly). So does
that mean that I should really develop a class for each of the tables
that I have in SQL Server and write the appropriate methods to handle the
retrieval and updating etc.. of the data separately from a business
class? Then obviously in the business class, I would instantiate and call
data class methods to do the job...

Does that sounds about right??

Thanks, Brad


Jul 6 '07 #6

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

Similar topics

3
by: andy2O | last post by:
Hello comp.lang.py, Can you help me with ideas for the following (somewhat newbie) OO design question in Python? Note, I'm using psuedo-code, not actual Python for the examples! Background:...
0
by: James Walters | last post by:
Hello, DB novice checking in here with a basic design question. I have a table called 'nms_apps' which stores information about all of our applications which we have developed/maintained for...
0
by: Krist | last post by:
Hi All, I have a database design question, pls give me some help.. I want to define tables for salesman's sales target commission . The commission could be given per EITHER sales amount of :...
1
by: Krist | last post by:
Hi All, There is some additional info I forget on this same topic I just posted. I have a database design question, pls give me some help.. I want to define tables for salesman's sales target...
1
by: dixp | last post by:
I'm new to writing multithreaded apps and I have a design question. I have a winforms app and a class which has a method that does processing which is time intensive. I want the user to be able...
3
by: reageer | last post by:
Hi all, I have a design question: I have a bunch of users (name, address, zip, etc.). They are assigned a card with a specific id. The only thing unique is this card id, or probably the...
7
by: Steve Long | last post by:
Hello, I have a design question that I'm hoping someone can chime in on. (I still using VS 2003 .NET 1.1 as our company has not upgraded XP to sp2 yet. duh I know, I know) I have a class I wrote...
29
by: Brad Pears | last post by:
Here is a simple OO design question... I have a Contract class. The user can either save an existing contract or they start off fresh with a blank contract, fill in the data and then save a...
9
by: fjm | last post by:
Hey everyone, I lost my internet connection for about 5 months and finally got it back. This is one of the first places I came back to. I have to say that I had a heck of a time finding it...
2
by: RoaringChicken | last post by:
Hi. Vista Ultimate Access 2007 I'm developing an inventory database and have question on design. The database stores collection details. One item in the collection, one record. The design...
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: 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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...
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...

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.