2

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)?

Nikola
  • 367
  • 1
  • 9

1 Answers1

3

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?

Atif
  • 915
  • 1
  • 6
  • 12