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

[FEEDBACK]Isn't this styleguide encouraging anemic domain models? #16

Closed
gbrennon opened this issue Feb 9, 2020 · 2 comments
Closed

Comments

@gbrennon
Copy link

gbrennon commented Feb 9, 2020

Hey phalt, how are u doing?

So... I'm currently following ur style guide on some projects that I'm currently working on and I've been thinking... Isn't this style guide encouraging anemic domain models?

Because you threaten the apps as our "domains" and don't write any domain classes and don't even write some mapping functions to map from domain to model and vice-versa.

You also say to people keep business logic on the service layer. But let's say that I have a Dog domain class and I want to implement the bark method. Following this guide I would implement this on the service layer and, lets say, do something like this:

class DogService:
    @staticmethod
    def bark(dog):
        return 'woof'

Would it be more meaningful to be written down like this?

class Dog:
    def bark(self):
        return 'woof'
@gbrennon
Copy link
Author

gbrennon commented Feb 9, 2020

Sorry, I've found the answer in an old issue.
This is on #1

@gbrennon gbrennon closed this as completed Feb 9, 2020
@phalt
Copy link
Owner

phalt commented Feb 9, 2020

Hey @gbrennon thanks for reading my style guide! yes, issue #1 clarifies some of this. I have pinned the issue now so people can find it easier.

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

2 participants