8

For programs written in an imperative/procedural style, this is next to impossible because the separate threads may access shared data, and correct semantics for larger-grained parallelism can't be easily ensured. Programs written in a functional style may be parallelized automatically since there's normally much less shared state, but it is still hard to ...


5

The point of microservices is to enable independent development and operation of parts of a larger software system. What is your goal in this project, what is the reason you are doing this? A microservice is not a subtree of a data model. It is a closed, feature complete part of the whole, that has (ideally) no request-response dependency to other systems, ...


5

The goal of a component diagram is not the same than a class diagram. Nor is it an alternative to package diagrams. The focus of component diagrams is on self-standing, replaceable components, and how these can be assembled to make more complex systems. 1) The ball/socket representation is about interfaces provided/required. So FooImpl would be a ...


5

Common e-mail server software (postfix, sendmail, presumably exim but I didn't check that one) supports forwarding to programs via pipes, so this isn't esoteric at all. Ticketing systems such as Redmine and mailing list managers such as GNU Mailman use it all the time. If you prefer not to run your own e-mail server, you can programmatically access ...


4

Exactly-once guarantees can be had the easiest with a (option 1) message queue system. This also neatly solves the problem of retries, as failed operations can be stuffed back into the queue, or a dead letter queue can be used. You can technically run n agents on the problem (option 2), and each agent only processes users with ((int)userId) % n == agentId). ...


3

Can you nest them? i.e. Interface IZoom { Tuple<int, int> Range {get;} // ... } Interface ICamera { IZoom Zoom {get;} // ... } So if there is no zoom the property is null? It doesn't make the cleanest of code, since you have to test all the time if the feature is present. On the other hand, if you are drawing the item, you have to ...


3

I guess Stephen Cleary expects a ports and adapters architecture to do all I/O in the outer layers and to pass in the results of these operations to the domain objects. In your example, this would be simple: pass in the content to the domain object rather than injecting IContentRepository: public class MyDomainObject { public void Foo (Content content) {...


3

I have seen many descriptions of the Facade Pattern state that it should provide a single interface into a complex subsystem. Segregating the interface seems to violate that axiom. It would be more accurate to say that a facade provides a simpler interface to a complex subsystem. A facade composes several low-level operations into a new higher-level ...


2

When it comes to business logic we agree that DRY principle is a cornerstone of structuring it well. However, this is not always true for the database world. The main reason is that assembling needed information from different sources requires additional costs. If we talk about the same database-scenario this is what denormalization is for: sometimes you ...


2

You can't "ditch the repository pattern" if all your classes are repositories despite the naming. Here it looks like both your datamapper and service are simply repositories. Flatten them out and call it a repository. Or lose the service layer. If it has no logic you don't have a service. The purpose of a layered design is to separate out parts of your ...


2

In most cases web hook is superior to polling. The only aspect that polling is unarguably better than webhook is that polling is usable when the client is behind a NAT and therefore can't make a listening port to receive a webhook. One case when web hook doesn't bring any advantage, but a polling architecture is signficantly simpler to implement, is when ...


2

To a regular application program there are just threads. Whether the processor has multiple cores or uses an army of leprechaun to get things done is irrelevant. What matters is the tasks implemented by the application and whether these can be performed in parallel while maintaining the functionality or not. Some applications can be reworked to benefit from ...


2

It's fair for microservices to access other services for data. I'd look into the saga pattern for ideas how to deal with distributed data in a microservices architecture.


2

Really you are just rearranging code to your personal tastes. You can have various arrangements such as: Object.Deploy() Deployer.Deploy(object) Deployer(object).Deploy() Personally, I don't like the Deployer(object).Deploy() because it leaves behind a useless Deployer object. Object.Deploy() is nice for things where the Object hangs around and has ...


2

The Dead Letter Collector seems to be doing two things: handling undeliverable messages, and handling messages that need to be retried (delayed delivery). This could be split into two collectors, particularly as the name "Dead Letter" implies (to me) that anything that goes there will never leave. Messages that can't be delivered for any reason can be sent ...


1

Typically, having multiple implementations of some feature would suggest a Strategy pattern: https://en.wikipedia.org/wiki/Strategy_pattern In your case, the situation is a bit more complicated, because one class (for each type of camera) might be able to do multiple things: record, zoom, flash, etc. What a specific camera can do, is a responsibility that ...


1

Component-based software is made of interacting components, where each component has a clear interface and is self-standing and replaceable. Components can therefore be developed independently of each other, and can be reused across projects. This component-based approach comes from systems engineering and system theory: systems are decomposed into ...


1

You need to make the adapter call to your domain. Async code can call both sync and async code. However, when sync code calls async you run into trouble. Simplest way to fix this is to pass a callback. How does the flow of execution on your project go? The code that does your dependency injection can be async, so it can call both sync and async code. See ...


1

It is true that if you start using async-await it spreads as a zombie along application pipeline and you will be forced to use async everywhere. Try to approach design from a bit different angle - domain logic care only about data. So we can put all IO related code outside of domain layers as close to the top layers as possible. 1 Load required data ...


1

Shared entity is a very common problem in microservices. Theorists of microservices argue that there shouldn't be any shared entities and it's a bad design if you have them But unfortunately that's a very common case. since a storage of a microservice is only accessible by that particular microservice hence there is no other way to access it and for shared ...


1

But what if someone in the front-end decides to send hundreds, thousands, or millions of these duplicated tags all at once? Can you handle it? (On both sides?) Imho, the easiest way for handling this is to make it so that, for example, the user interface in the front-end, uses a "chip-like" entry of data for these tags, that can come from a dropdown or ...


1

I'm noticing some fundamental issues with the basis of your question. The first issue is architectural. Strictly speaking, requirements changing on the front end (GUI) should be orthogonal to the other components of your application. Consider a bulletin board application. If one customer wants a dashboard with widgets and another wants a streaming feed, ...


1

The SRP is not about doing one thing, but about reasons to change. The case that you describe is on one side a Tree class that manages elements, and on the other side a State class that makes use of a specific tree. At first sight, creating an overload to enrich Tree with an add at root level does not seem to break the SRP: this overload does not ...


1

I think the closest you're going to get is something like OpenMP for C, C++, and FORTAN. This library allows you to parallelize some constructs like for loops simply by inserting a pragma or two before the code block: void simple(int n, float *a, float *b) { int i; // This assumes the blocks pointed to by a and b don't overlap #pragma omp parallel ...


1

First choice is better for security and independence between tenants, like the choice about database.But you have to build tools to handle it. Failure of one queue, don't expose failure to other tenants. First is not simple technically, but have functionals advantages : limited failure independence between tenants/confidentiality, eg: data cannot be ...


1

I think since you are targetting a robust system and concern about performance, it is better to use a queue system for Job execution and set up priority. I am not seeing any fault or problem storing ER and using triggers from the database but my question is why should we use triggers when we can use a fault-tolerant job queue system which is ideal for such ...


1

I've always liked NorthWindTraders as a clear example of how to properly use EF in a multi-layered application, without needlessly resorting to rolling your own UoW or persistence layer (which is a bigger hassle than it is a solution. Who is responsible for calling SaveChanges? That depends on who is doing the data operations. If your service calls ...


1

If the server decides when, how or how often to retry, then you can change your retry strategy at any time without having to modify the client. You may even use different strategies on different weekdays or at different times of the day; whatever suits your needs. On the other hand, a server can only retry promptly as the client needs to uphold a connection ...


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