New answers tagged

-1

In my opinion there's nothing "open-ended" about this. Only the underlying implementation of "the API" is aware of what it is supposed to be doing. Therefore, if you now try to "diddle" with the database you sabotage all of the logic that the API has implemented. "In a stroke," you have vastly increased the ...


0

Modern processors make use of 2 flavors of registers. architectural registers (exposed to the programmer) hardware registers (the ones uses in side) The X86/AArch64 have just a few architectural registers and this is a huge restriction on the performance because with just this limited number of registers, the instructions need to wait for an register to ...


2

Use common sense. Some assumptions (such as "input values entered by users won't contain SQL special characters") may have catastrophic consequences, others (endpoints A and B are called in that order, otherwise B will return a 500 server error) may just lead to slightly inconvenient error messages. Naturally, you want to always prevent ...


1

It's a great idea to publish client libraries for each of your systems. The only thing I would change is to make two. One for system A's request and response schema and another for System B's. That way you increment the version when there's been a change to the schema and clients can only use the one they need. I keep the client library in source control ...


2

This is absolutely possible. You can just pick literally any general-purpose CPU architecture that's simple enough for your liking - for example, a Z80 with a memory-banking extension - and write an interpreter for other architectures on that one. Z80 is relatively simple (and you could even remove the less-than-simple parts). x86_64 is not. If you have a ...


3

how do we keep the user authenticated on the mobile app even after the refresh token expires? All the famous apps out there do not prompt the user to authenticate let's say weekly or worst daily [...] This use case is the sole purpose of refresh tokens. So set the expiry to match how long you want the user to be able to stay signed in without being prompted ...


4

The problem is that you're replacing a relatively simple problem with a harder one. We already have a number of well documented file formats. These cover documents, still images, sounds and video. They have been implemented on multiple operating systems on multiple hardware platforms. So we know that the standards are well enough written. You want to replace ...


0

An Event Processor is a technical component. A service or a microservice is a unit of the functionality provided by the system, don't take it too literally, but you could call it a business function to distinguish it from the technical components.


1

From your post it is not clear whether team name is the name of a team member or of a team role. If team name refers to a team role which might change on the request of the user, but not too frequently you could use an array of strings and store the array in a property. The next step would be to decide how to maintain the property file. You can change it ...


3

The project I'm working on has a code dependency on a TeamNames enum. So you have data that relates to each Team. That says to me that Team is a data Entity that you care about and, since a Team can probably exist in its own right, that means it should have its own table. The problem with this is that the project needs to be recompiled and redeployed on ...


0

Without doubt an enum is a closed value domain, and also a bottle neck on maintenance, like rebuilds and vcs merge conflicts and so on. An interface for team name typed constants. For different groups could define a child interface (Responsibility principle). Packing this value domain in a type is good practice. So there could be a class Team (?). Database....


11

Creating a single-column table in a DB just for team names would be overkill IMO. Create a proper Teams table then. With a key and Name and maybe some other properties that a team may have. This can be shown to the user as a select box. The user will see the name, the application will use the key for all its operations.


2

Is there any better way altogether for validations? TL;DR: Parse, Don't Validate. ... takes a string argument in it's constructor. Checks if the string matches... This is a classic parsing example: you are starting with information in a general purpose data structure (a string), and trying to represent that information more specifically (a domain value). ...


2

You're right. You shouldn't offload responsibilities to the consumer for no reason. So if you are inside one app, and it seems you are, there is absolutely no reason to abstract away parts of the application. If you know you'll have to return a HTTP error, do that. Yes, from the "domain" objects. Purists will probably argue that domain and web must ...


2

Generally having a single "source of truth" or "authoritative source" is the best solution. If you have a microservice architecture then holding the personId and calling the person Api to get that persons data is how the design is supposed to work. Your reasons for rejecting this seem thin. The services are too coupled. There is the same ...


0

Cache coherence defines some ordering of loads/stores over a single address. Memory consistency defines some ordering loads/stores over multiple addresses. When looking at the wiki, it seems that memory coherence is the same as cache coherence. For more information see (you can download the book for free) https://www.morganclaypool.com/doi/10.2200/...


0

A strong memory model is one where every load/store is a synchronizing operation; so it will order loads and stores around it. A weak memory model is one that isn't strong; so there are plain operations loads/stores and synchronizing loads/stores. The only order that needs to be preserved for plain/loads and stores is the data dependency order; something is ...


0

I've been struggling with this for some time as well. The way I now interpret the dependency direction between the Gateway part (green) and the DB (blue) is as follows. Imagine you are using an ORM such as Hibernate or Entity Framework. You will implement your persistence in the gateway part using Entity Framework without having to think about the actual ...


1

There are a lot of ways to do it, depending on your requirements. I do this by returning the UI URL from the login request as follows... User navigates to the app in the browser. App's current version is retrieved (possibly from cache) and loaded. Login page is presented because user is not logged in. This means all users who visit our service without a ...


2

There are a couple of ways you could further improve this design on both the objects and the network api. First, your design currently focuses heavily on the data. It is basically a data model, which is generally considered an anti-pattern in object-orientation. You should instead focus on behavior, i.e. what these things should do, without exposing their ...


1

In your case i would expect that the client is specificly build for the backend and vice versa. That means, you do not expect that anybody else will ever use this endpoint, beside your client. The interesting thing about REST is, that its original use case was the internet. That means, someone provides an endpoint, and somebody unknown will use it. This ...


2

For a request like PUT /class/:id/attendance <list of students> I would find the steps you list to be a very reasonable way to implement the required semantics of setting the list if attending students to the provided list. Another way would be to blindly delete the current list from the database and then add the provided list, but there can be ...


0

Your plan 1 is good to go, but here is a bit of variation to consider : The db table will have s3 link to file. If your backend application requires only one bucket , it is not necessarily to store the same bucket link for each row to your database table, instead you can keep the bucket link as constant variable in code implementation, unless the backend ...


2

Why does this service need to know whether a book exists? Would that change anything in its behavior (except rejecting requests for invalid book ids)? If you define that service as just storing some status out of a finite list for arbitrary IDs (which may or may not be book ids) it could serve its purpose without introducing unnecessary coupling. For example,...


1

I agree with mtj's answer that the user's have no vested interest in jumping through hoops for your internal data's sake. However, I don't quite agree that that means you can't merge your databases. To summarize the below detailed explanation, the trick is to favor the user experience, and avoid needless spam or requests for action. Instead, the systems ...


0

Let's take Social Media Links. This subsection could include links to a Job Applicant's Instagram, LinkedIn, and more -- and for sake of simplicity, let's ignore that the fields can often be NULL... This is actually the part you should pay attention to. If they can be null, then they are optional. The other problem I see is naming these fields after the ...


0

What should come first? Opposing code-first and database-first assumes that one must necessarily drive the other. This idea is not modern: it is prehistoric. It ignores the evolution of software engineering in the last 40 years from sequential to iterative and incremental and agile approaches. Code and database are two side of the same coin (or 2 faces of ...


3

I don't believe either is inherently wrong, but here are my thoughts on both, and a description of my preferred pattern. For the first one This is no doubt a common and traditional pattern, but the challenges I see with the first are three-fold Scalability/Concentration risks. In this case every request has to go through a complex gateway logic that might ...


4

Great, more email for the spam folder... OK seriously now: your business' desire to merge the user accounts is not of concern for the customer. Therefore, the customer will not have any desire for your emailing them not have any interest in clicking your link eventually not even be an active customer any more who places any value on the account he has not ...


0

Why do you need to force B's users to reset their passwords? You could copy the hashed passwords from B to A. That said, if A and B use different hashing algorithms, you would need to modify the login process on A to handle that. Be aware that some people will not click on links in unsolicited emails. Give them an alternative.


1

I cannot mock the hard-coded entity if it's created inside the Use Case MyUserCase is expected to code some logic or even data types as implementation details. Right now, new MyEntity(...) is one of these details. You don't have to test implementation details. Ever. Moreover, from the testing standpoint, you don't even know that MyUseCase is building ...


0

knowing that this C project will not have a Symfony kernel (no KernelTestCase available) Well, you still need a framework to run C 's tests anytime. Don't you? I could remove the doctrine dependent code from the library and mock some repository interfaces, but I would then need to re-implement them in both projects A and B and this does not seem convenient....


1

Personally, I will go with the missing option: Since serviceB is an extension of ServiceA but with no reference to ServiceA to avoid circular dependency i.e that serviceB can do basically some necessary operations that ServiceA can do, e.g CRUD operations on "ItemC", you can then make ServiceB stateless by exposing an endpoint from ServiceB to ...


2

Another solution would be to expose an endpoint for serviceA which accepts also the new metadata (not the queries). And then change serviceA, that it would also persist those if provided. Also you could modify version 3 and just extract the itemC saving logic of serviceA. Then serviceA uses it in its own transaction and serviceB uses it also, but including ...


Top 50 recent answers are included