views:

58

answers:

1

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.
+3  A: 

Here's some abstract advice which may help you; yes switch operating systems, but not how you think - get virtualbox and load in a version of linux (ubuntu's nice and quick + well supported) then use that virtual os as your development os - this way you get the best of both worlds, and when you're finished working you simply close the virtual machine (saving it's state if you like) and have a nice clean pc to do what you want with.

The benefits are almost unlimited, for instance I have several virtual machines which I can load up whenever, some are testing setups, some mirror web server setups, I even have different editions of windows (such as an old XP with IE6) to test out browser bugs.

Surprisingly, I actually find my machine runs quicker using virtualbox; and please don't let the time to setup and run things worry you, as virtualbox is extremely quick, and you'll find your virtual machines load much faster than your primary os.

There are many other benefits which come with, but over all it's a very liberating experience :)

nathan
Wow - what a great answer. I feel like a great a weight has lifted off my shoulders. Another thing to add to my 'list of things to learn', but i think it will definitely save time in the future. Brilliant.
JW
Forgot to say....thanks.
JW
@JW no problem at all, I wouldn't add it to the list though, just do it - it honestly doesn't take any learning, download (small) install, click "create new operating system" type a name, select the OS type you're making, then simply click the settings, select the .iso you downloaded for the operating system and then click start - you're done and installing the OS, it is that simple + because it's only a light dev machine you're setting up all the normal OS swapping pain is gone (no transferring files, settings etc etc) just install os, install php+apache+svn + your ide and get going :)
nathan
just downloading it now. but...i hadn't thought about how my windows edition of PHPEd IDE is gonna work on an virtual Ubuntu machine. Do you run your Windows apps in a 'Windows Guest machine' inside the 'Linux Virtual box' which is inside the Windows host?
JW
@JW you can simply use wine [1] to run windows apps in linux :) [or swap IDE to something like Eclipse PDT which is free] [1] http://www.nusphere.com/products/php_ide_mac_wine.htm
nathan
@nathan - thanks. Funny that you should mention Eclipse - I trialled it a few years ago but the Eclipse module file paths (hashes) were so long that I couldn't install it where I wanted it on my PC. It annoyed me a bit and was one of the reasons why I ditched it..if only I'd known some solution to that file path problem eh! ;o)
JW