|
From: Alexander S.K. <al...@be...> - 2012-12-27 06:25:17
|
Basso, Luis Fernando writes: > a simple example, object TIMER As I see from the code, this is an only example. So, just for pleasure to close the timer automatically while closing the appropriate window we add extra data and methods to ALL classes and objects, to ALL controls, while we have already ON EXIT codeblock for windows and dialogs specially for such occasions. > > Still, nothing in this code affects the performance of hwgui It affects, and I already wrote about it. Every time we call any object data or method, when we write ::lFocu := .F., for example, the program looks for this data ( :lFocu in this example ). The more data and methods has the object - the more time is demanded to find that one, which is needed. A lot of such calls are placed in onEvent() methods - so, to handle each Windows message ( there are a lot of them in a second - you know ) the program makes many such lookups. The second point is the following: the more data and methods we have, the more complex is the code of a library, the more difficult is to correct it, the more difficult is to find a problem, if there is any. > The concern with having to make the lib is more flexible and powerful. Yes. But also fast, and easy to modify. So, I vote for keeping simplicity in base classes and for moving extra features to inherited. Regards, Alexander. |