singletons

Apr 25, 2005 02:16

(( this is a crosspost from plix.org ))

I don't know why this hadn't dawned on me before, but a big performance and simplicity boon to hydrogen (and most of my projects in general) would be to implement the layout driver, the database driver, and the other base objects as singletons. This should make modules and related *vastly* simpler as they can simply make a global call to the base class to grab the instance. This will probably also require that the layout/view maintain a full structure of data before pasing it, though this isn't much unlike how things are done now. Furthermore, it seems that it would be an interesting idea to implement a fair deal of logic in the view driver (not the view, but in the driver that implements the view) to determine what modules (core or extensions) have requested access to particular parts of the view data in advance. This will allow the view to start dumping data progressively (thus keeping memory consumption down) as it becomes "final" (i.e. there are no further operations pending against it).

Still messing with the JS behind the upload progress bar. The majority of the time involved with that has been involved in implementing and debugging various auxillary functions and classes such as those related to the Ajax (XMLHttpRequest) functionality. It's rapidly becoming a hell of a useful and general library, though, that should make my future projects a hell of a lot more interactive and aesthetically pleasing.
Previous post Next post
Up