Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Question: How to Implement DDD Without ORM Mapping Functionality? #86

Open
@molpako

Description

@molpako

https://github.com/molpako/Architecture-Patterns-with-Python

Hello, I’m using this book to study DDD. At the same time, I wanted to incorporate recent trends into my learning, so I started studying with FastAPI and sqlc.

However, since sqlc doesn’t provide object-to-table mapping functionality, I’m unsure how to solve this, and I need help.

In the book, SQLAlchemy’s mapper is used to bind the domain model to the table, and storage changes are accomplished by modifying the aggregate. sqlc is an ORM specialized in generating Go objects from raw SQL, so it doesn’t have the mapping functionality that the book uses.

Would it be appropriate to implement the functionality in the repository to reflect changes in the domain class to the DB, and then call that functionality in the service layer after making changes to the domain class? Or is it impossible to achieve DDD without an ORM that has mapping functionality?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions