java-like interfaces in gupta

forum.td.development (2005-2010)
Christoph Keimel

java-like interfaces in gupta

Post by Christoph Keimel » 17 Mar 2009, 16:59

 Posted by:  Christoph Keimel 

hi everyone,

i am looking for help to realize something like java-interfaces in gupta
3.1.
my goal is, to be able to switch instances of different classes (all
dervied
from the same base class).

i tried this solution (which fails):

1) it should be possible to define classes using the same interface later
on,
so i start by defining the FcInterface with the function "String
getLevel()"
which, on this level returns "Level: Interace"

2) next, i create another class "FcImplementation" which is derived from
FcInterface but it superimposes the function "String getLevel()" and
returns
"Level: Implementation"

3) finally, i created a controller Class (FcController) with a Method
"String getlevel()". when this funktion is called it should use a specific
instance of another class to retrieve the result. the instance used needs
to
be set in another method "setImplementation( FcInterface )"

when i test this contruction (create an instance of FcImplementation; give
it
to FcController; call "getlevel()") the result is always given back by
FcInterface. It seems as though gupta always calls a method on the
class-level
of the variable declaration. please have a look at my interface_test.app.

am i overlooking something? has anyone tried something similar?

thanks for the help!

regards,
christoph keimel
--
em software gmbh
Attachment: interface_test.app

Rainer Ebert

java-like interfaces in gupta

Post by Rainer Ebert » 17 Mar 2009, 17:13

 Posted by:  Rainer Ebert 

In Gupta/Unify you can use late bound function calls for this. See modified
attachement.

Regards Rainer

Attachment: interface_test1.app

Christoph Keimel

java-like interfaces in gupta

Post by Christoph Keimel » 17 Mar 2009, 17:31

 Posted by:  Christoph Keimel 

hi rainer,

great solution. thanks!
do you know where can i find more information on working with classes in
gupta?

thanks again,
christoph
--
em software gmbh


--
Erstellt mit Operas revolutionärem E-Mail-Modul: http://www.opera.com/mail/

Rainer Ebert

java-like interfaces in gupta

Post by Rainer Ebert » 18 Mar 2009, 10:01

 Posted by:  Rainer Ebert 

Hi Christoph,

my knowledge resources are:
- Old Read Only Gupta Newsgroups
- Old/Current Gupta Newsgroups
- Current Unify Internet Newsgroups
- Google
- TD Online Help
- TD Books Online
- The old Centura Pro
- SALExtension class library
- Samples from several peoples
- Books/papers from MD Consulting
- ...

Regards,
Rainer

aleksei mendez

java-like interfaces in gupta

Post by aleksei mendez » 02 Apr 2009, 00:35

 Posted by:  aleksei mendez 

Can you sendme the sample en apt please? tnx

Return to “td.development”

Who is online

Users browsing this forum: [Ccbot], [SiteExplorer] and 0 guests