BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

changing bold type to descendent type

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Model Driven Architecture (General)
View previous topic :: View next topic  
Author Message
Alex
Guest





PostPosted: Mon Nov 06, 2006 9:11 am    Post subject: changing bold type to descendent type Reply with quote



Is there any support to change an instance of an class to an descendent
class ?
Or do I have to create new descendent class instance copy all the attributes
from the parent class and eventualy the links between other classes and
delete the parent class instance?

Regards
Alex
Back to top
Peter Morris [Droopy eyes
Guest





PostPosted: Mon Nov 06, 2006 9:11 am    Post subject: Re: changing bold type to descendent type Reply with quote



Quote:
Or do I have to create new descendent class instance copy all the
attributes
from the parent class and eventualy the links between other classes and
delete the parent class instance?

That one :-)

The fact that you need to do this sounds a bit dodgy. Is it due to
remodelling and you need to evolve the DB or is it a requirement of your
application to change the object?



--
Pete

Blessed are the geek, for they shall public class GeekEarth : Earth {}
====
Audio compression components, DIB graphics controls, ECO extensions,
FastStrings
http://www.droopyeyes.com
====
Back to top
Alex
Guest





PostPosted: Mon Nov 06, 2006 9:11 am    Post subject: Re: changing bold type to descendent type Reply with quote



Pete,

It's an requirement, I have a class PotentialClient and for certain
potentialclients I want to store some extra information and some extra
(derived) calculations, I don't want to burden all the potentialclients with
this info.

Any suggestions ?

Thanx

Alex





"Peter Morris [Droopy eyes software]" <pete (AT) NO_droopyeyes_SPAM (DOT) com> schreef
in bericht news:454ef40f$1 (AT) newsgroups (DOT) borland.com...
Quote:
Or do I have to create new descendent class instance copy all the
attributes
from the parent class and eventualy the links between other classes and
delete the parent class instance?

That one :-)

The fact that you need to do this sounds a bit dodgy. Is it due to
remodelling and you need to evolve the DB or is it a requirement of your
application to change the object?



--
Pete

Blessed are the geek, for they shall public class GeekEarth : Earth {}
====
Audio compression components, DIB graphics controls, ECO extensions,
FastStrings
http://www.droopyeyes.com
====

Back to top
Peter Morris [Droopy eyes
Guest





PostPosted: Mon Nov 06, 2006 3:28 pm    Post subject: Re: changing bold type to descendent type Reply with quote

Hi

Quote:
Any suggestions ?

Definately! You should use roles instead.

Is a bus driver a different kind of human to a train driver? Ofcourse not,
they are both humans. The difference between them is the role they perform.

[Person] (Person) 1---0..* (Roles) [Role]

Role is abstract.

PotentialClientRole ---|> Role
ClientRole ---|> Role

Now you can make a Person a potential client like so

Person.Roles.Add(TPotentialClientRole.Create(BoldSystem));

The person may have many roles, you could add constraints to make ClientRole
and PotentialClientRole mutually exclusive.

Here's a short article, unfortunately the images are gone but it has some
example code etc. I might write it differently these days as the article is
over 2.5 years old, but I'm sure it's worth having a read.
http://www.howtodothings.com/computers/a866-role-based-programming-in-bold.html


Pete
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Model Driven Architecture (General) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.