New answers tagged design
2
votes
High Throughput Concurrent Map Access and Periodic Updates Causing Contention and Latency Spikes
Is the considered solution optimal, or is there a better approach to handle high throughput reads and periodic writes without causing contention?
Assuming you have a fairly constant read-load on the ...
1
vote
SERVICES in sending ENTITIES in distributed systems
In that passage, Evans is not strictly talking about domain services but service as a feature, a unit of behavior exposed to callers.
On the previous page, there is a chart of the different types of ...
0
votes
How to store product and pricing history in a product database?
I think prices of anything are very crucial and it is essential to store pricing so that they can be retrieved accurately without any complex logic except a single join.
For example: ProductA's price ...
0
votes
Why do payment systems verify the transaction once it has been completed?
Multiple parties and multiple verification are involved in order to prevent fraud. For example, the credit card system typically have several parties (payer bank, payer bank processor, card schema, ...
0
votes
Why do payment systems verify the transaction once it has been completed?
We can only speculate, but my suspicion is that what's happening here isn't that the transaction is being confirmed twice.
Rather, what's happening is that the first response confirms that the payment ...
-1
votes
Do Interactors in "clean architecture" violate the Single Responsibility Principle?
The Clean Architecture book clarifies SRP (p.62):
Historically, the SRP has been described this way:
A module should have one, and only one, reason to change.
Software systems are changed to satisfy ...
6
votes
Why do payment systems verify the transaction once it has been completed?
When you write "deducted the balance" it suggests you might be missing a key thing that is important to understand about banking systems. They don't really store 'a balance' for each account....
1
vote
Sandboxing interpreted code
Can I even handle segfaults in user code reliably?
No, because the worst case is that it doesn't segfault but instead overwrites part of the runtime's state which is in the same process.
You can't ...
2
votes
Accepted
Sandboxing interpreted code
It seems you have two conflicting requirements.
On one hand, you want direct, low level memory access from your language's byte code to the host.
On the other hand, you want to prevent the host ...
2
votes
How does a flow of architecture of a digital banking system looks like?
The internal operations of banks first started to be computerised in the 1960s, and proceeded aggressively in the 1970s. Keeping the books hasn't been done on paper for decades.
So I'm not exactly ...
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 ...
0
votes
Is it an anti-pattern to use interface for entity?
If you have a simple data-only object, declaring and using an interface costs very little.
Very often you don’t have a simple data object. Say you have an object that can persist or load itself. Or ...
0
votes
Accepted
Build an API for a graph app with + 30 millions data points
I think you might be making this a more difficult than it is. You have M data points to show on a chart. You can only actually display N data points at a time. You simply need to divide your point ...
0
votes
Is it an anti-pattern to use interface for entity?
Although not immediately obvious, your example demonstrates a common interface that represents the same conceptual data in two different domains.
This is one of the primary reasons to implement ...
0
votes
Build an API for a graph app with + 30 millions data points
The usual approach for allowing different zoom levels for 2D graphics is to use a tree-like data structure (for example a quadtree), or for a one-dimensional time-series just a binary tree, where you ...
1
vote
REST - Adding a new field
There is no relation to how information is given on a REST API and how information is stored in a database.
It is entirely normal and accepted that a REST API presents data from multiple database ...
0
votes
Is it an anti-pattern to use interface for entity?
The article you mention probably - more or less explicitly - places itself in the context of a Rich Domain model, or at least an architectural style where there is a "pure" business layer ...
0
votes
Is it an anti-pattern to use interface for entity?
I read an article about that using interface for entity is anti-pattern by these reasons
You need to understand this advice in context.
Programming to interface is a very well known and important ...
0
votes
Is it an anti-pattern to use interface for entity?
Two counterarguments:
quite often, there is a second implementation: a mock object for unit testing.
even if there isn't, it is a stronger split between interface and implementation.
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 ...
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 ...
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 ...
2
votes
How is exception handling implemented in software architecture?
In which document and how should I describe how exceptions are handled? For example, how exceptions from the business logic level should be handled on the presentation level.
You don't describe that ...
1
vote
How is exception handling implemented in software architecture?
For this whole answer, I'm referring to "you" and "someone else". This could be referring to people, but it could also be referring to two different applications, or two layers in ...
4
votes
How is exception handling implemented in software architecture?
This is probably not the answer you expect to hear, but
In your source code. Handling of exceptions requires some try/catch block in code, that's where you find the description how the exceptions are ...
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 ...
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 ...
0
votes
How encapsulating what varies can help us?
First of all: your pancakes know how to cook and plate themselves. In my opinion that's a code smell. It also obscures why you would want to encapsulate the pancakes.
Assume your EncapsulationExample ...
0
votes
How encapsulating what varies can help us?
Software engineering is about insuring against future, as yet unknown change.
As long as all your program never changes, i.e. all it does is serve pancakes, and pancakes have no other use than being ...
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 ...
0
votes
Accepted
Servlet Development Best Practices
Using constants for parameters is generally considered a best practice. As you stated, as long as you get the value correct in the constant you get type checking from the compiler each time you ...
Top 50 recent answers are included
Related Tags
design × 5108design-patterns × 884
architecture × 780
object-oriented × 594
java × 490
c# × 446
object-oriented-design × 426
c++ × 253
database × 218
domain-driven-design × 159
programming-practices × 152
python × 150
rest × 145
web-development × 143
database-design × 135
api-design × 124
algorithms × 105
api × 105
interfaces × 104
web-applications × 99
mvc × 99
php × 95
refactoring × 95
uml × 95
.net × 93