New answers tagged

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 ...
Bart van Ingen Schenau's user avatar
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 ...
guillaume31's user avatar
  • 8,391
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 ...
kandarp gautam's user avatar
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, ...
Ccm's user avatar
  • 634
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 ...
Steve's user avatar
  • 7,158
-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 ...
Jocelyn Englund's user avatar
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....
JimmyJames's user avatar
  • 25.2k
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 ...
pjc50's user avatar
  • 10.8k
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 ...
Doc Brown's user avatar
  • 201k
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 ...
Steve's user avatar
  • 7,158
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.6k
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 ...
gnasher729's user avatar
  • 42.7k
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 ...
JimmyJames's user avatar
  • 25.2k
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 ...
Chris Schaller's user avatar
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 ...
Doc Brown's user avatar
  • 201k
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 ...
Bart van Ingen Schenau's user avatar
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 ...
guillaume31's user avatar
  • 8,391
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 ...
Ilmari Karonen's user avatar
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.
Simon Richter's user avatar
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.2k
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
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
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 ...
Bart van Ingen Schenau's user avatar
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 ...
Flater's user avatar
  • 45.6k
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 ...
Doc Brown's user avatar
  • 201k
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
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
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 ...
wallenborn's user avatar
  • 1,980
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 ...
Kilian Foth's user avatar
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
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 ...
DavidT's user avatar
  • 1,224

Top 50 recent answers are included