Welcome, Guest. Register Now!
   
Mark Forums Read Mark Forums Read Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-24-2008, 12:13 PM
Junior Member
 
Join Date: Mar 2008
Posts: 6
Default Multi - Domain Project

Hi all,

I'm about to begin a project that will span across multiple domains and have come up with some potential pitfalls - maybe some of you have come across the same problems before...

OK, say we have domain123.com and domainABC.com (but there could be many more).

The codebase should remain very much the same across all domains as far as core functionality is concerned, but there will be some differences across the domains.

For example:
  • Forms defined in ZF may have slightly different fields over different domains
  • Templates used with MVC will differ over domains
  • Models may differ for some domains
  • Access to controllers/actions could be different over domains

I predict that the majority of these will remain over domains, however I need to create a transparent way of switching between forms, models and access lists based on the domain. This in itself doesn't pose too much of a challenge - I'm just concerned that doing it will introduce duplication into my code. Anyway, my thinking is as follows:

- DomainController.php (handles setting of application-wide settings such as baseURL, domain name etc that will be used by the rest of the application when deciding which forms/models to load)

- UserModel.php (example of the base functionality of a user model)
- UserModel_Domain123.php (extended from UserModel.php - provides custom functionality for Domain123.com)

Some utility methods would be available that would first check for a domain specific file (such as UserModel_Domain123.php) and if that wasn't present, then load UserModel.php as default.

This same technique will apply to the Forms problem.

The problem with this technique is that I need to do a file_exists() call every time a form class or model class is loaded - something i'm not particularly keen on doing to be honest.


Does anybody else have any experience with this sort of architecture - or any thoughts on problems like this?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 06:33 AM.