What are some good package naming conventions for domain specific object models. For example, say you have a Person.java POJO, would you put it in a mydomain.model or mydomain.entity or mydomain.om (object model) package. The idea is to separate the MVC model objects from the domain object model. Our MVC based application has a model package that contains behavior but using that package to contain our domain object model seems inappropriate and potentially confusing.
+1
A:
The package name you choose is irrelevant. model vs. domain vs. vo vs. foobar is all fine just as long as your team is all on the same page. I agree that this package should only contain POJO domain objects with no significant business logic.
John Case
2008-09-18 21:02:05
A:
Not only that, be careful in the naming convention of your namespaces. I've seen cases where namespace names where duplicated in different assemblies. Talk about confusion.
Thomas Wagner
2008-09-18 21:06:31
+2
A:
I use "com.mycompany.domain" personally, but that might not be the best answer.
bpapa
2008-09-19 01:01:51
A:
You might want to organize your packages vertically instead of horizontally to seperate functionality.
Eg.
com.foobar.accounting.model.*
com.foobar.accounting.view.*
com.foobar.invoicing.model.*
com.foobar.invoicing.view.*
may be better than
com.foobar.model.accounting.*
com.foobar.model.invoicing.*
com.foobar.view.accounting.*
com.foobar.view.invoicing.*
Martin
2010-07-19 19:59:09