Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separating class and its inherited class #43

Open
zamiramir opened this issue Nov 17, 2021 · 3 comments
Open

Separating class and its inherited class #43

zamiramir opened this issue Nov 17, 2021 · 3 comments

Comments

@zamiramir
Copy link

zamiramir commented Nov 17, 2021

As a user
I want to see the relation between a class and its inherited class and also separate the members where it should be
So that you will get a correct UML view of the classes.

example: https://github.com/drivendataorg/erdantic/blob/main/erdantic/examples/pydantic.py

Additional class:

class PlannedParty(Party):
    """A planned group of adventurers finding themselves doing and saying things altogether unexpected.
    Attributes:
        name (str): Name that party is known by
        formed_datetime (datetime): Timestamp of when the party was formed
        members (List[Adventurer]): Adventurers that belong to this party
        active_quest (Optional[Quest]): Current quest that party is actively tackling
        planned_quests (List[Quest]): A list of quest that party which can be tackled
    """

    planned_quests: List[Quest] = []

(Although this is an erd package, it can have added value. I understand if this issue is closed as it might not fit the vision.)

@apirogov
Copy link

I am also very interested in being able to represent inheritance and include Base/Child classes in the diagram, and also see what data fields are narrowed down (overridden) in child classes.

@pjbull (you did the last commit so I mention you, sorry if you are not the maintainer) is this something that you see within the scope of erdantic? If so I might try to work on this (if I don't find a more suitable alternative that can do it)

@pjbull
Copy link
Member

pjbull commented Jan 25, 2023

@apirogov Yeah, give it a shot and see where you get. I think the devil will be in the details in terms of providing users with options for how to show inheritance and when to not show it. (E.g., in our example we don't really want BaseModel in our diagram or str or Enum for the Alignment class.

@Magier
Copy link

Magier commented Feb 28, 2023

Chiming in to express my interest in this.
I have a somewhat more elaborate domain model with no single root, that will span out to all other entities. If this would support an 'inverse' lookup of sorts (i.e. point to Party and the PlannedParty will also show up in the diagram) would be awesome. This would make it very user-friendly to choose an entry point for the diagram.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants