daveystew
12-29-2010, 12:05 AM
I want to float something out there and see if it sinks or swims...
I would argue that a significant proportion (say, 50%) of files within a project are probably pretty general, and are concerned with everyday tasks, albeit slightly customised to the project and client in hand.
I would also say that it takes 2 or 3 projects before sets of classes can be considered road tested-enough to warrant being refactored into an external Library.
This being the case, that 1) classes are general, and 2) classes really need to go through several project iterations, I find it really strange that developers are SO ingrained with locking classes into fully qualified namespaces from the word go:
com.client.project.display.components.dropdown.Dro pDown
I would suggest that the following is sufficiently collision-proof, inherently more flexible, transferable between projects, and less fragile when it comes to refactoring:
display.components.dropdown.DropDown
And as soon as you need components in Project B that you used in Project A, you copy them across and they just work (without feeling out-of-place). And if they work well, and are even improved, simply copy them back to Project A (or on to Project C):
Projects
+- Project A
| +- display.components.dropdown.DropDown
+- Project B
| +- display.components.dropdown.DropDown
+- Project C
+- display.components.dropdown.DropDown
As opposed to fully-qualified project paths, where code is pretty-much locked to a single project:
Projects
+- A Project
| +- com.aproject.display.components.dropdown.DropDown
+- Another Project
| +- com.anotherproject.display.components.dropdown.Dro pDown
+- Yet Another Project
+- com.yetanotherproject.display.components.dropdown. DropDown
Of course, once the code has gone through a couple of project lifecycles, if it warrants it, promote it to a fully-qualified com.yourname.Library.
This is certainly not intended to be a poor man's source control, more a flexible way to pick and choose, iterate and improve code in a non-exclusive way as your experience develops across a range of projects .
In my experience, as long as you code cleanly and in a loosely-coupled, manner, there's nothing to lose and lots to gain.
Anyone care to comment!?
Cheers,
Dave
I would argue that a significant proportion (say, 50%) of files within a project are probably pretty general, and are concerned with everyday tasks, albeit slightly customised to the project and client in hand.
I would also say that it takes 2 or 3 projects before sets of classes can be considered road tested-enough to warrant being refactored into an external Library.
This being the case, that 1) classes are general, and 2) classes really need to go through several project iterations, I find it really strange that developers are SO ingrained with locking classes into fully qualified namespaces from the word go:
com.client.project.display.components.dropdown.Dro pDown
I would suggest that the following is sufficiently collision-proof, inherently more flexible, transferable between projects, and less fragile when it comes to refactoring:
display.components.dropdown.DropDown
And as soon as you need components in Project B that you used in Project A, you copy them across and they just work (without feeling out-of-place). And if they work well, and are even improved, simply copy them back to Project A (or on to Project C):
Projects
+- Project A
| +- display.components.dropdown.DropDown
+- Project B
| +- display.components.dropdown.DropDown
+- Project C
+- display.components.dropdown.DropDown
As opposed to fully-qualified project paths, where code is pretty-much locked to a single project:
Projects
+- A Project
| +- com.aproject.display.components.dropdown.DropDown
+- Another Project
| +- com.anotherproject.display.components.dropdown.Dro pDown
+- Yet Another Project
+- com.yetanotherproject.display.components.dropdown. DropDown
Of course, once the code has gone through a couple of project lifecycles, if it warrants it, promote it to a fully-qualified com.yourname.Library.
This is certainly not intended to be a poor man's source control, more a flexible way to pick and choose, iterate and improve code in a non-exclusive way as your experience develops across a range of projects .
In my experience, as long as you code cleanly and in a loosely-coupled, manner, there's nothing to lose and lots to gain.
Anyone care to comment!?
Cheers,
Dave