New answers tagged

1

I know this question is from some years ago, but I've been dealing with a similar modelling problem at the moment, and perhaps it will be useful to someone else to see what alternative opinions are out there. You're right, this section is a bit misleading and contradictory, as so much time is spent in DDD indicating that the domain design shouldn't be ...


1

I have never seen any pattern or variation that wasn't just a shell game. Fundamentally, you have two writes that you are trying to commit An update to the event bus (really, an update to the durable store of the event bus) An history in your own durable store Because these writes are fundamentally using two different locks, there's always going to be ...


1

Why not let a third "DatabaseLoggger" service update the database? So there will be only one app writing to the database, and none of the other apps is coupled directly to the db. All those other apps will have to send logging events to the service.


4

Synchronous is not instantaneous. The network operation still takes just as long, possibly longer because synchronous operations occupy threads longer, which decreases server resources. It's still possible for two drivers to hit the accept button at the same time. If you don't want the UX of a driver's acceptance not being confirmed, the only real ...


1

My question is, for scenarios similar to this, where a state changing operation is time sensitive, is it okay to make synchronous inter-microservice REST calls? Sure, but what happens if that call fails? Now you're in a state where the passenger is still looking for a ride and the person trying to accept the request gets the error with bad UX. Worse, your ...


0

How should this fit in a REST API ? A background task is not a ressource as users or companies can be. Anything can be a resource. It just needs a representation that both the client and server understand. You have a resource in the form of a "task". That "task" resource can be in different states since you say it can be started. So there are two states ...


1

In general GAE apps are intended to run as web services, in the sense that they're waiting for HTTP(S) requests and perform actions in response to them. While it might be possible to have them designed to register for pub/sub topics and immediately respond to them, achieving that may be a bit awkward and probably costly. IMHO a better approach would be to ...


0

I think you could move all behaviour which are depend on context (where the link is rendered) into the separate 'strategies'. Link provides public API (e.g. add/remove/change icon) which strategy could use in order to change the link. In terms of Angular it might be @Decorator which in constructor takes the Link instance and call link public methods. In ...


1

A background task is not a ressource as users or companies can be. Fielding, when defining REST, offered this definition of a resource: Any information that can be named can be a resource: a document or image, a temporal service (e.g. "today's weather in Los Angeles"), a collection of other resources, a non-virtual object (e.g. a person), and so on. In ...


2

Based on this definition of an n-tiers architecture, a tiers is a multilayered architecture where the layers are made of components. In fact, this definition proposed by one of our peers is very close to the more generally accepted definition used in scientific literature: A Multi-tier Architecture is a software architecture in which different software ...


3

The challenge in answering this question is that we are dealing with terms, in this case "tier", that have imprecise meanings and different people use the term differently. For example, a common view is that there is a distinction between layers and tiers. A layer is an abstract separation, as in the controllers, business logic and data objects in your ...


0

So if you want to the string idea: If you have a string M01MA24C04L02 instead of the letters M, MA, C, just parse the string based on the position, e.g. the first 2 characters are the model, the second two are the materials, etc But a better idea!: When someone designs a chair, they get a unique code to represent their chair design. You create a web api ...


0

I don't think you need any databases or anything fancy like cloud computing. Computers are fast, and you can wait a little bit for it to process. Do you really want to know count of every single combination of words at once or do you want to query just some of them? Here is the solution for knowing all of them: You can make a map of (word1, word2) --> (...


0

If you use the authorization code flow, you should save the access token and the refresh token. The access token can expire after a period of time, therefore you need the refresh token to get a new valid access token. About the ID token. Its purpose is not to be used when calling protected resources via API. The ID token is used for authentication, not for ...


0

No, You should not cache access tokens on the backend of a web application. You should store them client side and send them with each request. Some applications will store the refresh token for a longer period of time, say months, in a cookie or local storage so that you don't have to login every time you launch the application.


0

Using a JWT (please don't say JWT token since this means "Json Web Token token") mainly has the purpose of not having server side state in the interaction between your client and your server. The second you have any persistence (like a database) this whole statelessness is only relevant on the session scope. When you request access to a third party resource ...


1

This is how I have approached this problem. There are a few points I find important. Possibility to subdivide the progress into parts. It seem fairly common to either have separate phases in the work, or that each work item takes a considerable amount of time, so each work item should also report progress. I do not want to worry about the update frequency ...


0

If you want the front-end to determine progress, you can use Microsoft API for reporting progress. Example For server-side progress you have to implement callbacks from server to client in your service layer. I am assuming your algorithm does not require server-side progress indication.


0

First create a class that will contain e thread/task to do your background work. Add a method that will create and start the thread. Add an event Progress with event arguments that have a progress indicator, like a number somewhere in between 0 and 1 or two numbers, current and total. Have your thread execution method raise the event in each iteration, ...


8

A long running algorithm certainly could use some method of indicating it's progress. But it would be inappropriate for the algorithm to know that it's talking to a progress bar. The algorithm should be able to talk to adapters that can take what the algorithm says about it's progress and turn it into a progress bar, a log file, or noise over an audio ...


1

It depends in many other requirements like, is there any chance of introducing new vehicle types in near future? If so implementing obviously a better way because it will work like a plug and play. how many vehicle types are required to be considered? If many then surely implementing so many classes does not make senses is there other functional operations ...


1

This seems like something you can add fairly easily at any point (especially if this service if new, in terms of its life-cycle as a product, since in that case the cost of rewriting whole chunks of code is probably low). While it is OK to add support for anticipated features, especially where they can be expected with a degree of certainty and are well ...


1

There is much to consider when making a decision like this. Some of the questions you need to get answers for include: Can you afford to take the time to develop and test the currently unused code? Will it add additional requirements (like additional memory)? How likely is it that you'll actually need this feature in the near future? Will this additional ...


0

You need externalized authorization also known as attribute based access control (abac). Attribute-Based Access Control (ABAC) is actually what you are looking for. In ABAC you write policies that state what can and cannot happen. alfa and xacml are the two ways you can write policies. The good thing about this approach is that you can always change the ...


Top 50 recent answers are included