I've been programming in Java, C#, Python and AS3 most of the time and in all of these languages there are packages (or something like that). The problem I found is with the naming convention, or even with the organization of the packages. I need someone to tell me WHY is this:
com.company.app.type.Object
or org.authorname.project.type.Object
better than this:
app.feature.Object
or app.module.Object
Another example:
Why this:
com
+--company
+--app
+--events
| |--FeatureOneEventA
| |--FeatureOneEventB
| |--FeatureOneEventC
| |--FeatureTwoEventA
| |--FeatureTwoEventB
|
+--models
| |--FeatureOne
| |--FeatureTwo
|
+--services
|--FeatureOneServiceA
|--FeatureTwoServiceA
|--FeatureTwoServiceB
Is "better" than this:
company
+--app
+--feature
+--one
| |--Model
| |
| +--events
| | |--EventA
| | |--EventB
| | |--EventC
| |
| +--services
| |--ServiceA
|
+--two
|--Model
|
+--events
| |--EventA
| |--EventB
|
+--services
|--ServiceA
|--ServiceB
In the first one you have all organized by "types of objects", but the "features" are all mixed, but in the second one, the organization is by "feature" and each one has their own objects; so, you can see one feature well separated from another.
So, can anyone tell me why a lot of companies and programmers prefer the first?
event
in package name and in class name.