How to apply Clean Architecture when Application requires Use Cases to be executed on Client and Server

Viewed 120

let's assume you have an application that requires application (layer?) specific logic on both, the client and the server. E.g. in case of an offline mode or CPU heavy tasks.

First: is Clean Architecture still a proper abstraction/ software architecture?

Assuming yes, I started thinking of extending the Command/Query Bus in such a way, that it could delegate those requests to the client or the server. Would this be a proper approach?

I am new to Clean Architecture, but I tried to point out the Problem in its terms though.

Thanks in advance

EDIT:

Example 1: I want to annotate PDFs & model some charts always locally but upload them afterwards.

Example 2: I want to text search my locally available documents, if the remote storage is not available (e.g. no internet connection/ offline mode).

1 Answers

The essence of Clean Architecture is to put the (business) logic into the center of your application and push all IO to the outer most layers (circles) and then only allow dependencies from outside circles to inner circles. This way you keep your logic independent from "details" (IO, frameworks) which allows you to change those "details" later on easily and also improves testability a lot.

The principles of Clean Architecture can be applied to backend as well as frontend part of an application.

More on how to implement Clean Architecture on my blog: http://www.plainionist.net/Implementing-Clean-Architecture/

Related