[Lazarus] Strange dependency of units

Alberto Narduzzi albertonarduzzi at yahoo.com
Wed Apr 4 22:20:56 CEST 2012


>
> Separation is very advantages for large and/or "professional" projects.

separation, as you call it, is simply a good-design practice; no matter 
whether the project is small or big.
I quite don't believe (allow me this simple paragon) you would mix your 
winter and summer clothing in the same bag; and bring the very same bag 
with you to the beach and to the mountains...


> But it contradicts the idea of "RAD" (Rapid Application Development)
> that initially drove the invention of Delphi.

That's simply not true. a RAD tool can help you in many ways, but your 
code (your CODE) still needs to be hand-written. And your CODE generally 
is more likely to be NON-GUY (or not so strictly GUY) related.
Just to bring in a name every developer at least one time in his life 
has come across: the unit "utils.pas" had better be GUY-independent; as 
I doubt you would need a lot of graphic bells-and-whistles just to be 
able to use the function trimRight(s: string): String; Or do you...?


> Same is very useful for projects dedicated to starting,
> learning/teaching, prototyping, testing Pascal code, testing attached
> devices, staying small, etc. IMHO this is true by far the most projects
> ever started.

this may indeed be the one and only place where you could at least not 
bother with differences between GUY and NON-GUY environments.
True is that nowadays NON-GUY envs. tend to disappear; but you need to 
remember that FP is meant to be portable to (any) environment, including 
embedded systems; where this difference is still alive and kicking.


> Very unfortunately many 3rd party products available for free or payed
> don't adhere to the "separating GUI and business code" paradigm.

Hence I wonder why some people don't complain after having paid for them...


> Unfortunately many projects start "small" and at some point get so "big"
> that separating GUI and business code would be appropriate, but with an
> advanced project, the effort is a lot harder to do.

the problem must be approached the other way around... Anyway, 
separating GUY code from NON-GUY is not such a big task; you only need 
to know your tools. Or say, classes... what they do and what not.
The software is your tool, your instrument, and you better know it very 
well... indeed, I'd dare say that it's your due.


> This is especially true if it it turns out that the final product needs
> to be used as a service/daemon.

Sic. I'd; and probably not only me... ;-) probably kill you (but just 
cutting your hands would probably do as well), shall you implement a 
daemon with some dependencies on text/graphic specific library...


> Here the upcoming "Custom Drawn" Widget set some day might help to allow
> for some kind of "GUI remoting", and by simply switching the Lazarus
> Widget Type the GUI can be cut off.

Sorry, this one I cannot catch... :-O


Cheers, A.




More information about the Lazarus mailing list