March 4, 2010

sharing code between storefront and admin

Filed under: ZenMagick — DerManoMann @ 2:21 am

With my current investigation of using the ZenMagick MVC framework for admin pages I’ve finally hit the point where sharing all code (and configuration) hits a wall.

For example, url and sacs mappings have to be different, so there is no point loading the storefront mappings in admin (and vice versa).

Also, there is reason to have separate implementations of some classes. For example the current ZMController class uses $request->getAccount() to validate access. However, for admin requests this doesn’t make sense as there will never be an account instance, but an admin user reference.
The consequence is that a few more things need to be refactored to make the MVC code even more generic. It also means that it is now time to reorganize everything under the lib directory into shared and individual code for storefront and admin.

All this, or course, implies that storefront and admin stay within a single application – more to think about…

1 Comment

  1. I had a major issue trying to integrate ZC with another app due to the problem of different classes in the admin and catalogue having the same name.

    If you will be loading different classes in both, please try to give each a distinct name … same applies to functions. Even if it is only a prefix.

    Not yet really tried ZM yet but keeping a close eye and wishing you the best with it.

    Comment by Dayo — March 5, 2010 @ 8:26 pm

RSS feed for comments on this post.

Sorry, the comment form is closed at this time.