I'm using PHP 5.2 to make a website
I like to have explicit names for my classes
I also have a convention saying 'the path and name of a file' match the 'name of the class'
So a class called:
ABCSiteCore_Ctrlrs_DataTransfer_ImportMergeController
would sit in my svn working copy at:
C:\_my\websrv\ABCCoUkHosting2\webserve\my_library\vendor\ABCSiteCore-6-2\ABCSiteCore\Ctrlrs\DataTransfer\ImportMergeController.php
I find the naming convention gives me a better view of my code base, leading to better understanding and reducing the feeling of complexity.
Unfortunately there seems to be a max path length on my Windows XP PC. It seems to cause problems when I try to checkout Subversion files into my working copy.
If the path is too long, I can't check it out - the checkout fails.
So I find myself taking ages just to think of a name for a domain concept.
I might want to name a class "notification service" - but I end up calling it something like "NtfctnSrvce". It also cause problems when I try to create a specification class.
say, for example i'd love to have a spec class called with an explicit name,say:
$hasBeenNotifiedSpec = new ABCSiteCore_Model_MssgSys_Rules_Customers_HasCustomerBeenSentNotificationOfOnlineTransactionPaymentByEmail($notificationLog);
if($hasBeenNotifiedSpec->isSatisfiedBy($customer))
{
...do something
By using my file-to-class-name naming convention, I can simply use Windows Explorer to get a good idea of what the class does, its place /role in the Model/View/Controller pattern etc.
ABCSiteCore\
Model\
MssgSys\
Rules\
Customer\
HasCustomerBeenSentNotificationOfOnlineTransactionPaymentByEmail.php
Whenever i think of name for a domain concept, I've got into the habit of pasting the potential path length into a 'path length checker' to see if i can use it - its just a peice of pre-formatted text in my working-notes-wiki:
As you can see. Unfortunately that class name is getting close to the limits
C:\_my\websrv\ABCCoUkHosting2\webserve\my_library\vendor\ABCSiteCore-6-2\ABCSiteCore\Model\MssgSys\Rules\Customer\hasCustomerBeenSentNotificationOfOnlineTransactionPaymentByEmail.php
-------------------------------------------------------------------------------------------------------------------------------------------------------------------script path length danger zone------->|
----------------------------------------------------------------------------------------------------------------------------------------------------------------------max path length danger zone (inclusive .svn folder)------->|
C:\_my\websrv\ABCCoUkHosting2\webserve\my_library\vendor\ABCSiteCore-6-2\ABCSiteCore\Model\MssgSys\Rules\Customer\.svn\text-base\hasCustomerBeenSentNotificationOfOnlineTransactionPaymentByEmail.php.svn-base
Because of these path length restrictions, I tend to choose names for my entities that are not the best fit to the ubiquitous language of my domain model. This, can sometimes lead to misconceptions about how the system works, causes confusions and adds to the complexity - making development harder.
so :
- How can I solve this issue?
- is it solvable or is this just one one those practical constraints that we all just have to deal with?
- is this just a PC thing? It might be time to switch to Mac or Linux.