Recent

Author Topic: Should Application:TApplication be the singleton?  (Read 6262 times)

glorfin

  • Full Member
  • ***
  • Posts: 148
  • LMath supporter
Should Application:TApplication be the singleton?
« on: December 19, 2014, 01:02:39 am »
Hi!

Situation when Application is implicitly created at the initialization section of Forms unit prevents the creation of custom TApplication descendants, which sometimes could be convenient. Therefore, I'd prefer to have Application be explicitly created and initialized in the beginning of the program, like it was in good old Turbo Vision.
Well, of course, now one can start like:

begin
  FreeThenNil(Application);
  Application := TMyApplication.Create;
  Application.Initialize;
  ...............
end.

But it is neither elegant nor efficient.

 

TinyPortal © 2005-2018