I'm trying to understand the DDD architecture pattern. I wrote a simple project in which I tried to use DDD arch. Here are my doubts after implementing it:
- Does it make sense to use an ORM for a DDD project? Maybe I should drop the use of Base class from declarative_base?
- Where should I define validators - in domain objects or in repository objects?
- Should
SimpleService(session)take a session in the initializer or specific repositories that I will create in the main function? Now I create it here:
class SimpleService: """Creates simple service.""" def __init__(self, session): self.session = session self.post_repository = PostRepository(session) self.comment_repository = CommentRepository(session)
- What should I change or improve in whole project? Please give me a quick review.