July 25, 2007

more thoughts

Filed under: ZenMagick — DerManoMann @ 10:13 pm

Not a very original title, I have to admit, but it’s hard to find good titles when writing about the same topic all the time..

Object Cache

This is one idea had some time ago about how to speed up some of the dynamic settings that, despite being dynamic, do not change very often. One example would be the URL mapping, another could be the validation rules.

The plan would be to serialize those objects and store in a file based cache similar to the page cache. If a valid cache entry exists, that would be used, otherwise the code would be loaded as before.

I could also imagine using that for the categories. They are reasonably static, but take a long time to set up.

If I get time I’ll do some testing to see if there is actually any performance gain in doing this sort of thing…

Getter for (currently) global instances

This is probably related to the previous idea. Rather than setting up all globals as is done right now, ZMRuntime could have a generic getService(...) method. Internally, references could be stored in a hash. This would mean services would only get instantiated if they are actually used.

It would also get us closer to a system without globals!

Moving more stuff into plugins (for example the music code)

So far I tried to just rebuild the original zen-cart logic (even though a few things got dropped on the way). Some code, though, is optional like, for example, the music related service, model and UI code.

I really would like to convert some of that into plugins, or at least optional packages. Ideally, they would just add but not need to modify things. This might perhaps be the only time where I would allow adding code directly to the core folders, rather than just in a plugin folder. It might depend on how easy it is to extract and separate the code.

Admin

Well, I’ve had a few attempts to make the ZenMagick admin pages nicer, the latest being the fancy new menu. In the long run, though, I would think that a completely new structure would need to be used.

One good example of cumbersome code reuse is the code in sqlpatch.php. sqlpatch.php is the zen-cart admin page that allows to upload/install SQL patches. All the code is in that fil, including the HTML for the actual page.

So, in order to use that code ZenMagick adds another layer of output buffering, includes sqlpatch.php and then discards the output. It works, but is not a very scalable and easy to handle way of using other peoples code.

So, there might be more changes to the ZenMagick admin pages, but those will be more functional in nature.

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment

You must be logged in to post a comment.