9 votes

Is it an anti-pattern to use interface for entity?

Without the full context of this article, it's impossible to say exactly what the point of it was but I think I can provide a useful answer to your question. The first bullet "Your interface ...
JimmyJames's user avatar
  • 25.1k
6 votes
Accepted

In poltergeist, whats wrong with "solely to trigger or initialize several other objects"? Isn't it is a good use of encapsulation and reuse?

First, let me say the Wikipedia article about Poltergeist, as it is written today in Sept. 2023, isn't very clear. It lacks an example, suffers from some overgeneralization and oversimplification, and ...
Doc Brown's user avatar
  • 200k
6 votes

Is it an anti-pattern to use interface for entity?

Interfaces should be designed in their own right. They are not simply accessories to a class. That said, this: Your interface signature [is] identical to your class can actually be fine. It just ...
candied_orange's user avatar
4 votes

Is it an anti-pattern to use interface for entity?

Put it to the test: class JpaBook implements Book { // implement entity for JPA } class RedisBook implements Book { // implement entity for Redis(for caching) } If you delete implements Book and ...
nvoigt's user avatar
  • 7,337
3 votes

Event-driven design with delayed consequences

It sounds like you have a lot of conditions going on here, not a bad thing, but I think you will definitely need to ensure that your events are organized. Spend some time and diagram out your sequence ...
Chris Johnson's user avatar
3 votes
Accepted

Event-driven design with delayed consequences

Some part of your system needs to have the knowledge which fields of which objects are required before a certain procedure can be started. Usually, this knowledge is bundled with the procedure itself, ...
Doc Brown's user avatar
  • 200k
3 votes

How encapsulating what varies can help us?

As always the question for the "best" software design depends on the specific context and requirements, therefore there will likely be no definite answer, but lets introduce some concepts ...
Mathias Mamsch's user avatar
2 votes
Accepted

Implementing MVC in C++ with minimal boilerplate despite lack of reflection

I'm surprised nobody has mentioned the ancestor of a lot of MVC: Microsoft, in particular the MFC era. All the original work was done in C++. Some historical references: https://www.codeproject.com/...
pjc50's user avatar
  • 10.7k
2 votes
Accepted

How encapsulating what varies can help us?

It is the nature of an example that it is simple and that a reader can easily grasp its entire content without needing an elaborate explanation. It is the nature of real production code that things ...
Flater's user avatar
  • 45.4k
1 vote

Is this a bad pattern for reporting/audit?

Put the item on a message queue ... reporting events are frequently missing due to restarts Restart of what ? The message queue restarts: Surely you should be using a message queue service (plenty of ...
S.D.'s user avatar
  • 977
1 vote

Is this a bad pattern for reporting/audit?

The steps you listed in your question are a high level description of a standard solutions. It is too high level though, there are a lot of details of the implementation that are not trivial. First of ...
FluidCode's user avatar
  • 717
1 vote

Event-driven design with delayed consequences

Is there a clean way to do this with event-driven design? Yes. Queue up a "query" or "interact" event, and attach the backlog fields. This might arrange for an RDBMS query to ...
J_H's user avatar
  • 2,912

Only top scored, non community-wiki answers of a minimum length are eligible