Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.clipper.visual-objects > #2272

Re: Many different classes with the same code

From "Willie Moore" <williem@wmconsulting.com>
Newsgroups comp.lang.clipper.visual-objects
Subject Re: Many different classes with the same code
Date 2011-10-12 12:51 -0500
Organization Aioe.org NNTP Server
Message-ID <j74k3l$6p9$1@speranza.aioe.org> (permalink)
References <58f0e982-a6a2-4934-b42b-f0d820a80c75@q13g2000vby.googlegroups.com>

Show all headers | View raw


Krystian,

What I do is to look at my code and where I see repetitive code in more than 
2 places; I will abstract out the code into a base class and then inherit 
the code in my app. I keep my base classes in their own library so I can 
refer to them in my different apps. I do this with both GUI elements and 
classes. For example, I had a network app that had several forms that all 
had to process "floor", "Closet","pannel". I created my base form that had 
the logic to handle floor, closet, and pannel. When I did the inherited 
forms, I just set the inherit from to my form and all of the business logic 
for handling the floors was there.

Regards,
Willie


"Krystian"  wrote in message 
news:58f0e982-a6a2-4934-b42b-f0d820a80c75@q13g2000vby.googlegroups.com...

Hi,

I have many independent classes operating with the same databases and
with the same source code.
Currently  i copy to same code into this different classes - how may i
create one method and call it in different places in application ? I
do not want to create a function.

Thank you for advice
Krystian 

Back to comp.lang.clipper.visual-objects | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Many different classes with the same code Krystian <softb@softb.pl> - 2011-10-12 06:53 -0700
  Re: Many different classes with the same code "Stephen Quinn" <stevejqNO@bigpondSPAM.net.au> - 2011-10-13 01:56 +1100
  Re: Many different classes with the same code "Willie Moore" <williem@wmconsulting.com> - 2011-10-12 12:51 -0500
  Re: Many different classes with the same code D.J.W. van Kooten <public@ic2remove.this.com> - 2011-10-14 13:48 +0200

csiph-web