3

So I'm having this issue. I'm a student and also am working but somehow I was never told or shown how to exactly put classes to packages according to good practices. In my job the project is big, but created long time ago by people who aren't best programmers, so it's all very chaotic. At my university nobody seems to care about this.

I feel like it's very basic thing and yet I'm not entirely sure. I will ask the question with java in mind, so let's say that I have those classes like User class, UserForm for changing user data class, UserController class, UserRepository class and let's say the same classes for something not that related to user, like Shop.

How should I put those in the packages? What should the structure be?

user3212350
  • 401
  • 1
  • 6
  • 18
  • 1
    one packed called "model" to contain all data / data-base related classes . personally the rest is at your wish – Srinath Ganesh Mar 28 '15 at 15:33
  • 1
    http://www.javapractices.com/topic/TopicAction.do?Id=205 – Srinath Ganesh Mar 28 '15 at 15:34
  • @SrinathGanesh this doesn't seem to be backed up by anything. In fact, your link exactly contradicts your advice. – Boris the Spider Mar 28 '15 at 15:35
  • Wanted to post the same link, but the question was closed. I recommend package by feature like the above link does. – sschrass Mar 28 '15 at 15:38
  • I as a student [smaller projects] prefer packages like (model,util....) , but at the same time have seen suggestions of better ways to work [might help on bigger projects] so i made a mention of both in separate comments – Srinath Ganesh Mar 28 '15 at 15:44
  • @SrinathGanesh absolutely not! If you start out with a small project this way and they grow over time, you're screwed. – sschrass Mar 28 '15 at 15:55

0 Answers0