Skip to content

Separation of Concerns #86

@shz

Description

@shz

This is becoming more of an issue than we thought, unfortunately, and may require more re-architecting.

Here's a sample workflow:

The owner of a listing answers a question. The client understands that to do this, it must update the "answer" field on the model. As such, it pushes a diff ({answer: foo}) down the line via the update message.

The server receives this message and applies it to the database. Next, it checks the update to see what fields were changed. It notices that the answer field was updated, and says "aha, this means the owner of a listing has answered the question" and performs special logic accordingly (in this example, sends an email to the guy who asked the question).

See the issue? The action being taken is "answer the question," but this action is obfuscated when the update is sent. Is it an issue now? Not so much. A bit of special logic here and there. It'll become an issue when we start adding more "special functionality" to the server. Rep, for example. We'll need to start inspecting every single update/create/delete operation and trying to figure out what actually happened. This could get messy.

Compare that to this workflow:

The owner of a listing answers a question. The client sends a message (do-answer:{inquiry: "deadbeef", answer: "An Answer!"}) to the server. The server knows that answers need to update the relevant inquiry data, and that it should send an email to the user. It does so.

I'm not saying this is the approach we can take, but it's food for thought.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions