liuyang1520 / django-command-extensions

Automatically exported from code.google.com/p/django-command-extensions
MIT License
0 stars 0 forks source link

Abstract classes are not drawn #67

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
If you have a class with

Meta:

    abstract = True

It's not drawn.

Original issue reported on code.google.com by jjconti@gmail.com on 24 Oct 2008 at 3:06

GoogleCodeExporter commented 8 years ago
I have a working prototype of drawing abstracts, but I'm afraid that it will 
become
confusing for people.

The main question here IMHO is if graph_models should draw diagrams based on the
database model or class-model. Personally i think having a database centric 
diagram
is better. (but maybe we should do both)

The graph_models command currently shows the model as it is according to the 
ORM. In
that sense "abstract = True" is only a bit of trickery, the models in the ORM 
and in
the Database will have all those fields. Therefor there is no relation between a
field in an Abstract Base Class and the class that implements it. All the fields
defined by the ABC are part of the model that implements it.

However if you take the view of a class-diagram, then abstracts obviously need 
to be
drawn as separate entities. 

Drawing abstracts separately causes the diagram to become much harder to 
understand,
it will not be clear (on first view) what fields are on what model since some of
these fields are 'hidden' in abstract classes. Also there would be need for 
extra
types of connections (arrows and lines) to indicate an abstract base class 
connection.

Original comment by v.oostv...@gmail.com on 21 Nov 2008 at 10:28

GoogleCodeExporter commented 8 years ago
As a follow up, i now committed a patch for graph_models in svn where 
abstract's on
models are indicated by a italic <AbstractModel> under the model name, as well 
as
making all abstract fields italic.

Original comment by v.oostv...@gmail.com on 21 Nov 2008 at 10:29

GoogleCodeExporter commented 8 years ago
since there's no activity on this ticket, i take it that people like my UML 
type of
solution by showing abstracts as a parent/superclass of the model.

Original comment by v.oostv...@gmail.com on 6 Feb 2009 at 9:04