A Developer WeBLOG RSS 2.0

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:

  • RWendi.Foo.BLL: this is where I put the business logic layer of the Foo application
  • RWendi.Foo.Blob.DAL: this is where I put the data access logic layer of the blob component, of the Foo application
  • RWendi.Foo.Utility: this is where I put all the utility classes of the Foo application. Utility is not necessarily a software layer, but it is a self contained logical piece of the software, thus warrants a namespace on its own.
The fact that we have software layer at the end of the namespace, makes it easier to decide what logics need to be put into the namespace. but what happens if its the main namespace? What kind of logic would you put inside the RWendi.Foo namespace?

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

Sunday, November 02, 2008 7:48:20 AM UTC |  Comments [0]
Programming
OpenID
Please login with either your OpenID above, or your details below.
Name
E-mail
(will show your gravatar icon)
Home page

Comment (Some html is allowed: a@href@title, b, blockquote@cite, em, i, strike, strong, sub, sup, u) where the @ means "attribute." For example, you can use <a href="" title=""> or <blockquote cite="Scott">.  

Enter the code shown (prevents robots):

Live Comment Preview
All Content © 2012, RWendi