Skip to content

Addition to Why not put your business logic in APIs / Views / Serializers / Forms?"" #170

Closed
@ashrub-holvi

Description

@ashrub-holvi

Hi, just read the style guide, looks good, quite similar to what I think!
Small note to "Why not put your business logic in APIs / Views / Serializers / Forms?" section:
third should be - business logic doesn't related anyhow to way-you-call-it/transport/endpoint and just because of that it should be separated - you may want to call service function from management command, periodic task, admin action whatever, but if you placed it in HTTP API it makes it difficult (e.g. you need to have special API user, perform not needed network call etc).
It's sort of mentioned in another place:

We try to treat Celery as if it's just another interface to our core logic - meaning - don't put business logic there.

but perhaps good to mention it in a main place.

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