Michael Van Canneyt wrote:

This is the world upside down. Better tell us exactly why you think
this must be possible. the 'Sometimes there is a valid design for
something like that' is not an argument at all. Maybe there are other
- more valid - ways to accomplish what you want.

I can give you loads of examples where I had to implement workarounds in Object Pascal to get around that "limitation".

Have ever tried to write code in a similar fashion as Java does? One class per unit. You will hit that issue very quickly. What about having two-way referencing in objects: Customer.GetOrders and Order.GetCustomer. Or Many-to-Many relationships.

For all these you need to revert to Interfaces or use base classes (TObject or TtiObject) and do lots of casting in the implementation section. These are all workarounds for a language (compiler) limitation, which does not exist in other languages like C++ or Java. Alternatively you have to use one HUGE model.pas unit and all your various business classes in there - and maybe even structured via include files and have lots of forward declaration at the top of the model.pas unit. Problem then is that any class can reference any Private or Protected fields in other classes. :-(



Regards,
  - Graeme -

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


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

Reply via email to