Re: Bussines objects
From: Joanna Carter \(TeamB\) (joannac_at_nospamforme.com)
Date: 02/25/05
- Next message: Cor Ligthert: "Re: Obtaining Culture Info ???"
- Previous message: redneon: "Re: Screen Refresh Event"
- In reply to: Patrick B: "Re: Bussines objects"
- Next in thread: MyGeneration: "Re: Bussines objects"
- Reply: MyGeneration: "Re: Bussines objects"
- Reply: Frans Bouma [C# MVP]: "Re: Bussines objects"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 25 Feb 2005 10:03:47 -0000
"Patrick B" <newsgroup@devzoo.com> a écrit dans le message de news:
#RYsCttGFHA.3156@TK2MSFTNGP10.phx.gbl...
> A "business object" is just a class that represents a real entity with
> which you work. For example, if you work with customers and orders, then
> you might have a Customer class and an Order class.
>
> Check out the following link:
>
> http://www.mygenerationsoftware.com/dOOdads/dOOdads.aspx
>
> The tool from MyGeneration can create C# code for business objects
> automatically from tables in a database. Then you can bind controls in
> your gui to that.
As useful as you might think such a tool is, I would seriously advise
against using database design as the foundation for class design. There are
several patterns, like foreign keys, that are not necessarily correct in OO
world.
e.g.
Database
========
SalesOrder
ID
Date
CustomerID (FK)
Tax
Total
OrderLine
ID
OrderID (FK)
Quantity
ProductID (FK)
LineValue
Classes
=======
SalesOrder
ID (unique ID held internally, not used in client code, just by storage)
Date
Customer (object not ID)
Lines (composite list only accessed through AddItem method on this class)
Tax
Total
OrderLine
ID (unique ID held internally, not used in client code, just by storage)
Quantity
Product (object not ID)
LineValue
It is usually the job of a mapping layer to maintain the solution to this
apparent mismatch between the Object Layer and the Database.
Joanna
-- Joanna Carter Consultant Software Engineer
- Next message: Cor Ligthert: "Re: Obtaining Culture Info ???"
- Previous message: redneon: "Re: Screen Refresh Event"
- In reply to: Patrick B: "Re: Bussines objects"
- Next in thread: MyGeneration: "Re: Bussines objects"
- Reply: MyGeneration: "Re: Bussines objects"
- Reply: Frans Bouma [C# MVP]: "Re: Bussines objects"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|