"I admit, this is taking more time then I have to spend. But I keep my promise so here it goes. " If could serve as a consolation, all your help cames at the right time. Just after i have an new Project. And contrary of the last ones already spent two weeks
without open VS. Just Visio and Sql. To me, this means something. Just hope don't forget the deadline to production! "Yes I understand bettern now why the word Collection is used. But the problem is that you are not making the change in the mindset from Data
Structures to Objects. " I fully agread. I keep your words next time i work in a model. JCasa
Just don't spend too much time on design (2 weeks that is a lot of time). Visio is not really that good, contact me (nbplopes@netcabo.pt). Maybe I can help. As for an O/R Mapper that supports Natural PK (composite) on .NET I don't know any. But I can't believe
that there are any out there. As for OJB.NET is on a Major restructure so I would not advise you to use it for the time being, just for prototypes (but is moving faster then ever). Glad to help, have fun, Nuno
Nuno :: but only one combination of columns is choosen to be the PK Correct. :: now this combination should form the basis for your OID's don't you think? I don't know what you mean by an Object ID. What is an Object ID? :: The interesting thing is that object
creation does not require :: knowledge about the O/R Mapper. That's good. Are you on the development team for OBJ.NET? :: As for an O/R Mapper that supports Natural PK (composite) on .NET I don't know any I do. Of course, I haven't released it yet.
Hi Soul, "I don't know what you mean by an Object ID. What is an Object ID? OID is the key that uniquely indentify the object (The Identity), wether persisted or unpersisted. "That's good. Are you on the development team for OBJ.NET" No. My teams just use it
for simple things. We are actually in a process of evaluating O/R Mappers for .NET.
:: OID is the key that uniquely indentify the object (The Identity), wether :: persisted or unpersisted. There is a disconnect. Let me explain my point-of-view, and see if any of this matches what you call an OID. As I've mentioned before, I like to use a synthetic
key for the PK in my database tables. Its just something I do out of habit to save me any trouble that a business key as PK can cause. This synthetic column I call a SAK (system-assigned key) and its a number field, starting with 1 and being incremented for
every new record that's inserted in the table. Now this SAK field obviously has no business meaning. Its just an invented number used in the database. And its only purpose is Identity in the database. If I get a record from an outside source, and I need to
put that record in my database, I'd have to compare any and all business keys to see if this record is the same as one of my existing records in the database. I couldn't compare the SAK, because an outside source has no idea what a SAK is and the record wouldn't
have a SAK value. If a business key matches, then I can perform and UPDATE. If no business key matches, then I'll insert the record and assign it the next available SAK number. If I query a database row into a C# object, there's no need for the object to have
the SAK value, because like I said, its a database value with no business meaning. I had thought about putting it in the object, since if I modify the object and persist it back to the same database, I want to update the same record (and we've already discussed
why a business key comparison wouldn't work for this, I must use the SAK). However, I found away to keep the SAK in another place outside of the object. I opted for this route so as not to clutter the object with a useless value. In fact, many times I'll write
my class definitions before even deciding that I want to persist my objects in an RDBMS. I'd rather not have to go back and add SAK placeholders to all my classes just to persist them properly. Its best if the O/R Mapper handles that transparently. Now an
object can have 0 or more business keys. Any and all of them could be consider an Object ID, though I perfer the term Business ID, since these keys apply to the record in any data format it may take (XML, RDBMS, Object). So let me try to answer your original
question now... :: Yes the class can have multiple of being the identified, so can a :: record through Candidate Keys but only one combination of :: columns is choosen to be the PK, now this combination should form :: the basis for your OID's don't you think?
No.
I don't think there is a disconnect. It seams that your SAK concept map's to my OID concept, even in the way that it is used. :: Yes the class can have multiple of being the identified, so can a :: record through Candidate Keys but only one combination of ::
columns is choosen to be the PK, now this combination should form :: the basis for your OID's don't you think? :No Well I respect you answer but you are loosing one thing. If I could have a function that computes the OID given (X values) without needing to
go to the database, it means that your legacy DB example could use the GetObjectBYID without executing a Query by Criteria. Furthermore it would be an easy way to implement custom Compound Natural Keys by giving an ellusion that actual natural keys are used
when in fact only Syntetic Keys are. Anyway, this is all just a hack as if Natural Keys where fully supporte in a "proper" way there would be no need to have an OID or SAK column in the DB for every mapped table. Nuno
Nuno, I had looking at the example models from Step 10. Just one doubt. When they have an <>class, usually he have an DefaultValue, and if is linked with an <>, <>,<>class, this child class have an CustomValue. Does this mean that the <>,<>,<> class has an
oportunity to have an new value and consequently the <> goes to keep it has the new defaultValue? About my "pretender" model. Do i map each class to an db table? (Of course after have it as an finished model.) Thanks JCasa
The Archytype Description mean that a particular class describes a set of objects that represent real "entities". A catalogue or cataloguing schema are good example of description classes. For instance: ProductDescription [1:N] Product Product is the "real"
thing that is the thing that actually get's transacted in a moment-interval (The product on helf in a Supermarket, the peace clothing in a Shop, the Car in a Car Stand). Most people confuse these two concepts when doing an e-commerce framework for instance,
what they call a product is actually a ProductDescription. As for defaultValues, the it is usually put on the DescriptionPrice. For instance suppose in the example above you could a defaultPrice on the description and if eventually the product gets sold on
a different price, this price would be put on the Product itself. The collaboration is the following. If the product does not have a price set, then default to the price set to its description Class Product private Product myDescription; void Money Price {
get { if (this.price == null) then { return this.myDescription.Price; } else { return this.price; } } The point is the Product delegates certain properties to the Description class, sometimes even behaviour. So any system using the Product as no knowledge
about its Description. The same happen between's the Party, Place or Thing and Roles. Roles "pretend" to be the real thing to its users. For instance: Person <> [1:1] Customer <> [1:N] Order <> Person <> [1:1] Employee <> [1:N] EmploymentContract <> The person
has an property called FullName. So basically both Customer and Employee would have: Customer/Employee Class private Person rolePlayer; void String FullName { get { this.rolePlayer.FullName; } } "About my "pretender" model. Do i map each class to an db table?"
Yes. Even if the class has no attributes, just behaviour. Anyway be carefull with classes that have no properties or associations by themselfs, they are excellent candidates to be collapsed as commonly Classes like this don't add real value to the Model. Have
I answered your question? Nuno
One more thing, this is just an example how Descriptions and Party, Places and Things can collaborate. It does not mean that it is correct for your PD. You may use or not a Description as a provider of default values. Nuno
"Have I answered your question? " Yes, thanks a lot. "Most people confuse these two concepts..." Yes, because usually (with the datamodel keeping mind) if i have an class say Customer, i saw it as an entity, not an role player. I think this means (remember
Herbarium) : <>Herbarium [1:N] <>HerbCollection<>Herb [1:N] <>Loans [N:1] <>Borrower [1:1] <> Organization if i need to keep an State in an Herb (good, bad, damage, etc.), when is created thru an Sample, but could be changed by an Loan, does this make sense:
1. add an <>StateDescription 2. Link it to Herb to have an initial State (when created) as: <>StateDesc [1:N] <>Herb [1:N] <>Loans [N:1] 3. Link it to Loan to could modify the state as: <>StateDesc [1:N] <>Loans [N:1] No who's in charge to modify State to
an Loan? My thought is that this is the responsability of the <>Borrower So add an operation as UpdateState to the Borrower. At same time to give an initial State to an Herb, i supose that this is an atribute of the Herb, that is assigned at his creation.
Sorry to turn again to my "pretender model", it's just because i'm trying to improve it, and at same time learn as much as i can about DNC. Already search for discuss DNC, but at least in .net, could'n find any. Thanks JCasa P.S. i take the Borland Togheter
Control testing version, but couldn't see anything about prices. Is it so expensive that they prefer first get people satisfy to don't afraid? and have send you e-mail because of Visio, as you had propose me in previous post.
João Ca...
Member
500 Points
100 Posts
Re: Pencil and paper design
Oct 17, 2003 06:13 PM|LINK
nbplopes
Participant
1745 Points
349 Posts
Re: Pencil and paper design
Oct 17, 2003 09:02 PM|LINK
SoulOfRealit...
Participant
775 Points
155 Posts
Re: Pencil and paper design
Oct 17, 2003 10:11 PM|LINK
nbplopes
Participant
1745 Points
349 Posts
Re: Pencil and paper design
Oct 18, 2003 09:08 AM|LINK
SoulOfRealit...
Participant
775 Points
155 Posts
Re: Pencil and paper design
Oct 19, 2003 06:37 PM|LINK
nbplopes
Participant
1745 Points
349 Posts
Re: Pencil and paper design
Oct 20, 2003 09:20 AM|LINK
João Ca...
Member
500 Points
100 Posts
Re: Pencil and paper design
Oct 20, 2003 09:45 AM|LINK
nbplopes
Participant
1745 Points
349 Posts
Re: Pencil and paper design
Oct 20, 2003 10:23 AM|LINK
nbplopes
Participant
1745 Points
349 Posts
Re: Pencil and paper design
Oct 20, 2003 11:14 AM|LINK
João Ca...
Member
500 Points
100 Posts
Re: Pencil and paper design
Oct 20, 2003 11:27 AM|LINK