On Fri, Jun 21, 2013 at 5:29 PM, galgal <weglarek.rob...@gmail.com> wrote:
> But I can see now that there will be a massive amount of models. Each player 
> should have his own statistics for each games, there will also be a part for 
> referees. Referee work will be rated by users so - many models is planned. If 
> I put it in one app, I will have at least 15 models in it and I think it will 
> increase in some time
>
> Division in my example will clarify it, for example players app with all 
> models for players like player base, player in season, player statistics and 
> of course all logic in it.
>
> In 1 app there will be a many many lines of code and after some time it will 
> be hard to develop I think.
>

Welcome to software development.


In general, draw a diagram of your models and how they relate to each
other. Separate models which logically are only slightly related into
different packages - literally draw a line around the models in the
diagram.

For example, in your sports models, you have primitive objects like a
Game, a Player, a League, a Team and so on. All these are highly
coupled together, and belong together. Later on, you discuss
statistics on one of these things. Statistics are only loosely related
to the primitive game objects, and so should be in a separate package.

A useful rule of thumb is that if you have a package "A", it can
import from "B", but "B" should not import from "A". If they do, they
are tightly coupled and should belong in the same package (or,
potentially, your design is unclean - tight coupling is not a desired
trait of software components).

If you are more interested in this topic, I'd read "Software
Engineering - a Practitioners Approach" by Pressman.

Cheers

Tom

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to