Martin Friebe wrote:

True, but not the point, sorry.

I know and understood that. I just wanted to make it clear that by pulling in 
"gui" units into a CGI (non-gui) application is not a good idea.


So the question I was raising was: Is forcefully avoiding any multi-app scenario the right solution?

Well me being someone that loves OO design and all things to do with design 
patterns have the following thought - my opinion only. ;-)  The Application 
variable, as introduced in the Forms unit encapsulates an application. Seeing 
that you also only create one application per executable, there should in 
theory only be one Application variable/instance/singleton. To me, this should 
apply to GUI or non-gui (console or cgi/web based) applications.


The problem was started due to being forced to use a unit, that the developer didn't want. IMHO this must be solved,

Correct, and exactly the same problem I had to resolve in the tiOPF framework. 
Many non-gui functionality units pulled in GUI units. The biggest culprit was 
the Forms unit as well. And seeing that all my applications are non LCL or VCL 
based, I did not have a Forms unit in fpGUI Toolkit, so quickly discovered the 
problem. Reworking the tiOPF frame was required and a few abstractions 
implemented to separate the gui and non-gui code.


Regards,
- Graeme -

________________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/


--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to