Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I have a simple MVC project. My current packages:

  • gui
  • controller
  • db
  • domain

I want to put extra classes which I will use, e.g. md5 hashing, email validator (methods which I will use in more than one class). Where do I put them? I will probably not use them in only one package, but in two or three (not in model for sure). Do I create an extra package, or do I put them in domain as they're "static" (unchangable)?

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

What you are looking for is a "utility" package. This may include classes with static utility methods used all over the application. Common utility classes are String operations, Date/Time, etc. Your validators could be a subclass of the utility package, but personally I would put them in the domain in a higher "common" directory.

Refer to this answer for more details: How should I organize my source tree?

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.