>> case, it's a single instance class.
>
> Yes Victor, I see your point. I insisted on a deeper aproach because I was
> hoping the discussion would reach issues like singleton inheritance, but now
> I understand it's not a convenient discussion for now.
>
>>
>> If anything, Harbour may support
Hello Mindaugas
I do not see a problems here also. In both my and Teo's sample extra class
is created but it i not hidden from "other users around the world" (i.e.
MyClass1Real() function is public and visible). It is easy to make this
function static and accessible only from same module publi
Hi
I do not see any reason for such limitation.
The above #xcommand is universal rule you can define once in some global
.ch file and then you can use it as many times as you want in one or many
modules. I would only modify it a little bit adding protection against
1-st concurrent call in MT env
Hi
I understand, but before we start implementing something
brand new native, which BTW leads quite far away as far
I can see it, even my simple proposed method can be used
without too much concern, and even it can be used by 3rd
party libs to provide such singletons, or whatever we call
it. AFA
Hi,
Leandro Damasio wrote:
My proposition is that singleton class support for harbour be
implemented in such a way that one programmer can declare a singleton
class, box it in a library and share it to other harbour users around
the world, knowing for sure that nobody could instantiate it mor
On Tue, 24 Nov 2009, Leandro Damasio wrote:
Hi,
> > I know that you want to integrate it at low level in the Harbour Object
> > engine, but how about the following sample:
> >
> > #xcommand SINGLETON CLASS [ FROM ] => ;
> >FUNCTION () ;;
> > STATIC obj ;;
> >RETURN iif( obj = NIL,
Mindaugas Kavaliauskas said:
Since I do not know anything about singletons and doubletons, here is two
simple different implementations that came to my mind (and I guess 5 more
different approaches can be use to get the expected result):
Hello Mindaugas,
Please forgive me , I wasn't compre
>> This looks like a PUBLIC var initialized with
>> an object from an INIT PROC and protected from
>> additional instances.
>
> Thanks Viktor
>
> Sure it could be explicitly implemented as you suggested for some cases, but
> my intention is to propose a more comprehensive solution.
>
> If singl
Teo Fonrouge said:
> I know that you want to integrate it at low level in the Harbour Object
> engine, but how about the following sample:
>#xcommand SINGLETON CLASS [ FROM ] => ;
>FUNCTION () ;;
> STATIC obj ;;
>RETURN iif( obj = NIL, obj := S_(), obj ) ;;
>CLASS S_ [ FROM ]
Hi,
Case 1) A singleton class:
//---//
CLASS MyClass SINGLETON // THIS IS A SINGLETON CLASS!!!
DATA Status INIT 0
METHOD ChangeStatus() INLINE ::Status := 1
ENDCLASS
Viktor Szakáts said:
This looks like a PUBLIC var initialized with
an object from an INIT PROC and protected from
additional instances.
Thanks Viktor
Sure it could be explicitly implemented as you suggested for some cases, but
my intention is to propose a more comprehensive solution.
If si
On Nov 24, 2009, at 2:54 PM, Leandro Damasio wrote:
> Hello Teo!
>
> >I don't understand what do you mean by natively, if you mean to:
> >- Limit the number of instances
> >- automate the instantiation
> >- calling in the app
>
> By native singleton pattern class implementation I mean to provi
This looks like a PUBLIC var initialized with
an object from an INIT PROC and protected from
additional instances.
Brgds,
Viktor
On 2009 Nov 24, at 21:54, Leandro Damasio wrote:
> Hello Teo!
>
> >I don't understand what do you mean by natively, if you mean to:
> >- Limit the number of instanc
Hello Teo!
>I don't understand what do you mean by natively, if you mean to:
>- Limit the number of instances
>- automate the instantiation
>- calling in the app
By native singleton pattern class implementation I mean to provide that a class
could be declared as a singleton class and that this s
On Nov 24, 2009, at 9:26 AM, Leandro Damasio wrote:
> Hi,
>
> My name is Leandro Damasio and I have started to follow Harbour Project Main
> Developer List few days ago. I recently started 2D Informatica with my
> associate Ted, to develop commercial aplications using [x]Harbour. We used
> x
Damasio
From: Fernando Athayde
Sent: Tuesday, November 24, 2009 12:51 PM
To: Harbour Project Main Developer List.
Subject: Res: [Harbour] Singleton Design Pattern in harbour objects
why don´t you help a development of hbqt, seems a good api (multiplataform),
and you can make include files in a hwgu
Leandro,
On xbase++ you can create them this way
http://databear.wordpress.com/2009/08/28/xbase-singleton-pattern/
Maybe you can adopt this to harbour.
Maurilio.
Thank you Maurilio
The author suggests to use class var and class methods to implement
singleton behaviour in xbase++. In most c
gret, guess harbour with one gui mantened by group, is fabulous
Thanks,
Fernando
De: Massimo Belgrano
Para: Harbour Project Main Developer List.
Enviadas: Terça-feira, 24 de Novembro de 2009 13:03:10
Assunto: Re: [Harbour] Singleton Design Pattern in
A minigui wrapper to qt is done by hbqtcommand
a xbase++ wrapper to qt is done by Pritpal in contrib\xhp
so a hwgui wrapper will be intresting to try the qt powerfull
In future hi hope that we can manage set syntax to cover differences by GUI
like designed in vianemo
also a wvt wrapper will be i
2009 12:26:50
Assunto: [Harbour] Singleton Design Pattern in harbour objects
Hi,
My name is Leandro Damasio and I have started to
follow Harbour Project Main Developer List few days ago. I recently started 2D
Informatica with my associate Ted, to develop commercial aplications using
[x]Harbour
Leandro,
On xbase++ you can create them this way
http://databear.wordpress.com/2009/08/28/xbase-singleton-pattern/
Maybe you can adopt this to harbour.
Maurilio.
Leandro Damasio wrote:
> Hi,
>
> My name is Leandro Damasio and I have started to follow Harbour Project
> Main Developer List fe
Hi,
My name is Leandro Damasio and I have started to follow Harbour Project Main
Developer List few days ago. I recently started 2D Informatica with my
associate Ted, to develop commercial aplications using [x]Harbour. We used
xHarbour + BCC55 + HWGUI for about 3 years, until we read xhb-diff.t
Is there native support to singleton (design pattern) classes in harbour?
Thanks
Leandro Rocha
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour
23 matches
Mail list logo