To my definition, a Namespace is a container/place holder that defines a piece of logical unit in a software system. At the very basic, Im following this namespace naming convention of: CompanyName | ProductName | [TechnologyName] | SoftwareLayer. Technology name is something optional, thus im putting it inside a square bracket. The software layer part is what usually defines the kind of logics/classes that would go to the Namespace. For example:
The way that I use the main namespace is usually as place where I put all the things that are related to the application in general, but not related to any of the software layer. Things like initialization logic, entry point logic, application wide events, and enumerations. Lately I had a side project to develop an API, and one of the thing that I realised is that you can not apply the same rule to APIs. An API doesn't necessarilly have an entry point, initialization logic, or even an event. I had problem figuring it out on how should I utilize the main Namespace of the API, what should I put inside the main Namespace of the API?
I then realised that the API main namespace should realy contain the API logic itself. If I think about it, "An API IS a business logic layer". If an API purpose is to provide an interface to another program, then the main API namespace should contain the classes necesssary to make a request to the API's program. If an API is responsible to provide some business logics, then the API main namespace should contain those business logic classes. Having accustomed to seperating business logic classes to another namespace realy blinded me this time, because it really doesnt make sense for an API to delegate the business logics classes to another namespace.
RWendi
Remember Me
a@href@title, b, blockquote@cite, em, i, strike, strong, sub, sup, u