Hot answers tagged

6

It seems someone gave you an explanation you did not really understand, and now you ask strangers on the internet if they can give you a better one? Well, I don't know that company or product, but from what you wrote let me make an educated guess what could be the real motivations behind this architecture. If a software developer can do this well enough, ...


4

Interacting with a dependency I want to try to leave as much code untouched and limit the amount of changes I have to make to the classes that interact with the framework "classes that interact with the framework" will always have to be changed, because they interact with the framework. The goal to abstracting your code is to minimize the amount of code/...


4

The best you can do is to minimize the dependency on the framework in question, and to isolate the interactions with the framework to a single component or layer. So basically following good design principles like separation of concerns, program-to-interfaces and low coupling. It is tempting to try to create a layer which abstracts away the differences ...


4

Your analogy is intereseting and heading in the right direction. Microservices are like user space drivers Yes and no: Yes, like user-mode drivers, microservices provide an independent functionality in their own tiny and independent process. Minix drivers run as independent process to offer a functionality that would otherwise be (or at least run ...


3

The Adapter suffix is likely inspired by a similar pattern used throughout Java AWT/Swing for listener interfaces, such as MouseListener and MouseAdapter. You're right that this is not the typical GoF Adapter pattern, but looking past the name, there is a bigger design smell in having two types that are effectively identical. You may not want to implement ...


2

An UML sequence diagram shows an example sequence of events/calls that happen for an interaction of a single actor with the system. If you have multiple interactions with the system that can happen in various orders, but they don't directly affect each other (for the processing of input 1 it doesn't matter if input 2 is also being processed at the same time)...


2

You could try to abstract everything right now, but that isn’t useful if you don’t know yet what the next framework will be. If you use similar calls to access the framework, you can think about putting duplicate code into one method, just to reduce the lines of code you’ll have to change, but it’s too early to do any abstractions yet. When the time comes, ...


1

Your question is hard to understand. Based on some of your statements and expectations, I suspect that there's a misunderstanding on what exactly an interface does (as opposed to an implementation). What I think has happened is that you've tried to boil it down to the essentials (and that's a good intention, don't get me wrong), but you've boiled the wrong ...


1

In a strongly typed language, this would be handled by the compiler based on the types in signatures. For dynamically typed languages you can use the double dispatch approach. For example, the whole mixed-type arithmetic in Smalltalk is implemented that way. In your case, a method copyInto in class Foo would call copyFromFoo of the target, which then can ...


1

Indices: UI will query things like list of active events (endtime is null), amount of events per component in a data range. I could make component_id an index. Would it make sense to make a text column an index if it's used in searching? Indices in a database are mostly useful when searching for an exact match. If that is also how you look for entries ...


1

How would you implement a StringBuilder class from scratch? By thinking very seriously about why I have to implement StringBuilder from scratch. The proper reaction to that question is to ask "why?". Without a good reason why all you're doing is showing off that you know how to implement your own StringBuilder if stranded on a desert island. Not typically ...


1

The issue is super common with one very common solution. If you're working on a java application, you create a request filter in which you configure an MDC (comes from slf4j and uses a ThreadLocal underneath). Normally you would either populate your MDC with a content of x-request-id header or generate a new UUID if the header is not present. Then the MDC ...


1

It might be helpful to understand why the Repository and Service Layers exist. The purpose of your Repository layer is to provide CRUD operations. The Service Layer is there so that you can provide endpoints that return aggregate business objects instead of making multiple (expensive) CRUD calls to your Web API and assembling a complete object on the ...


1

Is there any standard, methodology, or something? There is and there isn't. There are many differrent approaches to documenting software specification, requirements and architecture. Many of which claim they are the 'standard' way of doing things. But because there are so many of them, none is accepted by majority as the best way of doing things, so none ...


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