I have created a Poker Game with GUI; it has model, view, controller, viewController packages, that hold sufficient files.
E.g. model holds: CardModel
, CardDeckModel
etc.
I have also created few enum classes: CardSuit
, CardRank
etc.
So my question is: should I create a separate package for this enum classes or I should put them to model package?
It depends on the use. The main point about model/view/controller... separated packages is that, if for some reason you create another project B which needs the model from project A, but doesn't care about the others, you can cleanly get your model package out of A, into its own project C, and then use that project C as dependency to both A and B, reusing your code without including too much code. To be able to do that, the semantics is that classes (and interfaces, enums, everything) in model can only refer to other elements in model; elements in controller can refer to elements in controller or model; elements in view can refer to elements in controller, view or model; and so on. If a class on your model imports a class from controller you couldn't extract your model as described. That being said, you order the layers by that dependency meaning and for each enum look where are the classes that this enum needs? You have to put the enum in the 'minimum' layer that has any reference to that enum. That's in a general case, in yours, by the names of thos enums, they seem to be used in model (which would be the lowest layer), so they seem they belong there