OOP Design patterns

forum.sourcecode (2000-2005) & forum.td.sourcecode (2005-2010)
shuet

OOP Design patterns

Post by shuet » 11 Oct 2006, 10:00

 Posted by:  shuet 

Has anyone implemented GOF design patterns with Centura ?
I need a few one i'll post here if no one has already made them.

Regards,

Seb

Jonas Mandahl Pedersen

Re: OOP Design patterns

Post by Jonas Mandahl Pedersen » 11 Oct 2006, 12:11

 Posted by:  Jonas Pedersen 

Before using too much time on this, please bare in mind that:

a) You do not have contructors in TD, TD supports the new method, but will
only return a class of the type specified with Gupta default values. Has a
Descructor method, but use it with causion.

b) There is no sort / clone / serialise functionality (might find some 3rd
party components like XSal doing some basic class operations for you.

c) In general it is very hard to make general classes handling different
type of classes as they all need typed reference.

Am very interested in what you come up with.

Jonas

RainerE
Germany
Posts: 2213
Joined: 27 Apr 2021, 12:40
Location: Germany

Re: OOP Design patterns

Post by RainerE » 11 Oct 2006, 12:24

 Posted by:  Rainer Ebert 

a) why?

c) Perhaps it would help to make a global class and inherit each class from
that?

Rainer

Jonas Mandahl Pedersen

Re: OOP Design patterns

Post by Jonas Mandahl Pedersen » 11 Oct 2006, 14:01

 Posted by:  Jonas Pedersen 

a) Why what?, you mean the destructor?
The destructor some time GPF the entire runtime (TD 2.1 ptf 4)
Especially when working with large arrays of objects.

Jonas

RainerE
Germany
Posts: 2213
Joined: 27 Apr 2021, 12:40
Location: Germany

Re: OOP Design patterns

Post by RainerE » 11 Oct 2006, 16:28

 Posted by:  Rainer Ebert 

Yes I mean the destructor. We use TD 4.1 PTF2 and did not see problems with
it. But we do not do something with large arrays in the destructor.

Rainer

Jonas Mandahl Pedersen

Re: OOP Design patterns

Post by Jonas Mandahl Pedersen » 12 Oct 2006, 15:20

 Posted by:  Jonas Pedersen 

Ok, maybe a reason to upgrade.
I am not talking about large arrys in the destructor it self, as you can
only work with elements inside the class, but situation where you have a
class A and a class B, and inside class B you have declared a array of class
A.
When destroying class B the destructor for each array object of type class
A, should be called, but sometimes and only sometimes you willl get invalide
refernce error, even though the desctructor for class A only deals with
variables inside the class it self.

Jonas

RainerE
Germany
Posts: 2213
Joined: 27 Apr 2021, 12:40
Location: Germany

Re: OOP Design patterns

Post by RainerE » 13 Oct 2006, 19:44

 Posted by:  Rainer Ebert 

I think that this problem is still present in TD 4.1/2005.1 PTF2. I've seen
a case where this happened with our software.

Rainer

Return to “td.sourcecode”

Who is online

Users browsing this forum: No registered users and 0 guests