domain driven design – Clean Architecture: Can Use Cases Imply UI?

In the chapter “Business Rules” of his book “Clean Architecture”, Robert C. Martin comments on the relationship between use cases and the UI:

(…) the use case does not describe the user interface other than to informally specify the data coming in from that interface, and the data going back out through that interface. (…) Use cases do not describe how the system appears to the user. Instead, they describe the application-specific rules that govern the interaction between the users and the Entities.

Context

For some context, I’m writing a simple client app (Android) using Clean Architecture + MVP in the presentation layer. Though MVP combines the controller and presenter, I’m still trying to think of them as independent aspects of the “interface adapters” layer in Clean Architecture.

In my app, users can create new events or edit existing events via a simple form UI. Each event has a start date, an end date, and a description. In my “domain” conventions (what I understand to be the convention convenient for doing useful operations uninfluenced by any one framework), an event is a simple Kotlin data class:

data class Event(
  val startDate: LocalDate,
  val endDate: LocalDate,
  val description: String
)

My form has simple behavior:

  • Show a loading spinner while an existing event is loaded from a remote data source.
  • If the selected start date is after the selected end date, then the end date is moved to be equal to the new start date. For example, if the end date was set to 2020-06-01, then I set the start date to 2020-06-02, the end date would now also be/show 2020-06-02.
  • Show a loading spinner while the event is being saved to a remote data source.

My understanding is that Clean Architecture describes the “business rules”/”use cases”/”domain” of an application to be application-specific behaviour implemented using conventions that will not be influenced by frameworks chosen to implement details such as UI. In my case, that means working with events treating dates as LocalDates, even though my UI inputs dates as year, month, and day Ints and ouputs them as Strings.

On one hand, handling the loading state and relationship between date inputs seems like a presentation concern because my use cases shouldn’t know anything about the UI. However, leaving the controller and presenter to be interface adapters which simply translate from a framekwork-like conventions to domain-like conventions and vice versa, and leaving them unaware of each other, the domain seems like the only place left to implement these behaviors. That leaves me with a use case output port something like this:

interface EditEventOutput {
  fun showLoading()
  fun hideLoading()
  fun renderEndDate(date: LocalDate)
}

My Question

That looks like a presenter’s view interface to me, but my presenter is unaware of this behavior. I tried using more generic terms, like an isLoading Boolean instead of the terms “show” and “hide”, but that’s not solving my issue.

The interface I’ve ended up with looks like a UI! It doesn’t discuss details about the UI, like what “show loading” means (i.e. it could be a line of text in a terminal, or a fancy UI widget), but it still implies the existence of UI.

So, even though use cases do not describe how the system appears to the user, do they imply the existence of some user interface? If they should not, and we should be capable of implementing the output ports on any sort of interface adapter (maybe it doesn’t even output to a UI), then where do I implement behaviors such as handling a loading state and the relationship between my start and end date pickers?

why do all black looters matter protestors ignore the fact that George Fraud had a criminal history and wasn’t a clean cut person?

Miranda was a scumbag too, but thanks to his case, you now know that you have the right to say, “I want to speak to my attorney” and then clam up when you’re arrested.  

Excessive force, particularly when it’s lethal, is a problem when it comes to law enforcement.  It has been a problem for a long time, while society and the government has repeatedly looked the other way.  Police brutality is a major issue and it needs to be handled.

George Floyd didn’t deserve to die like that.  It’s that simple.  You’re just looking for any reason you can to justify murder.  If you or I or any civilian knelt on the neck of a man for nearly 9 minutes, while 2 other civilians held him down and a third stood by in order to intimidate anybody who might intervene, then there would have been arrests and murder charges filed almost immediately.  So how come civilians are held to a higher standard for restraint than supposedly trained professionals?  Let’s fix the system and make it better.

gounlimited.to | Lifetime file storing, no deletion due to inactivity – Clean Ads – 24Hrs Payouts – Oldest video host since 2016 | Proxies-free

About

The GO Unlimited service, which may be known by the name of many of you, is one of the oldest services specialized in the field of video hosting. The goal of the service has always been to ensure the provision of a secure and stable platform for its long-term partners, in addition to providing features and characteristics commensurate with their aspirations and of course renewed development in order to ensure keeping pace with industry requirements.

GO Unlimited, 2020

In the year 2020, we seek to transfer the service from the field of traditional video hosting to integrated solutions in this field, by providing advanced tools, some of which were not previously proposed or used in this field, in order to keep pace with the development contained in this industry and its requirements.

————————————————————–

Our Goal

Our primary goal is to ensure the long-term stability of the platform and the stability of the services the tools it provides to its partners. We work in GO Unlimited on the basis of long-term plans and not short so as to ensure the opportunity to work for many years and successfully meets the aspirations and aspirations of our partners.

Our work since 2016 and our accomplishments are evidence of this goal that we seek. We will always continue to work on this goal.​

If you have any suggestions, or inquiries, we will always be glad to hear.

WindowsInstaller folder cleanup. Clean msp & msi patches marked as superseded

Has anyone tried this script ?

https://forums.mydigitallife.net/threads/presenting%E2%80%A6-startcomponentcleanup-for-msi-including-office.77708/

It cleaned up about 6Gb of files in my windowsinstaller directory most of them was old Office 2016 patches.

Is there a downside of cleaning up old and marked as superseded msp & msi patches in installer directory ?

gounlimited.to | Premium ads free player for only $29.99 – Clean Ads – 24Hrs Payouts – Oldest video host since 2016 | Proxies-free

About

The GO Unlimited service, which may be known by the name of many of you, is one of the oldest services specialized in the field of video hosting. The goal of the service has always been to ensure the provision of a secure and stable platform for its long-term partners, in addition to providing features and characteristics commensurate with their aspirations and of course renewed development in order to ensure keeping pace with industry requirements.

GO Unlimited, 2020

In the year 2020, we seek to transfer the service from the field of traditional video hosting to integrated solutions in this field, by providing advanced tools, some of which were not previously proposed or used in this field, in order to keep pace with the development contained in this industry and its requirements.

————————————————————–

Our Goal

Our primary goal is to ensure the long-term stability of the platform and the stability of the services the tools it provides to its partners. We work in GO Unlimited on the basis of long-term plans and not short so as to ensure the opportunity to work for many years and successfully meets the aspirations and aspirations of our partners.

Our work since 2016 and our accomplishments are evidence of this goal that we seek. We will always continue to work on this goal.​

If you have any suggestions, or inquiries, we will always be glad to hear.

java – How to achieve both: clean (hexagonal) architecture with JPA goodies?

How do I achieve both goodies of two things at the same time writing Java Spring Application:

  1. Clean Architecture
  2. JPA goodies (@Transactional, Optimistic Locking, dirty checking, etc).

I like the idea of database / orm framework being a not-important detail that can be easily replaced, but I’m not sure how to effectively implement it.

Let’s say potentially I want to replace JPA/Hibernate with jOOQ or Spring Data JDBC.

But at the same time, I want to have support for transactions, dirty checking, etc.

How should I process use case in a application / domain layer so it can have merits of two worlds?

I don’t have to mention that with clean architecture I have to convert domain type to entity type every time I speak with database.

Any good answers appreciated much 🙏

Install MacOS (Snow Leopard) on a clean hard drive, from windows pc, from iso or whatever else

Problem:
A friend have a MacOS computer. The hard disk inside started ticking (probably stuck heads). Hard disk was unusable.

He bought an empty hard disk but when he replaced it, it was giving a folder with a question mark icon (missing OS I suppose).

He brought me the empty hard disk asking me to reinstall OS on it. I never used Apple products.

I usually do this kind of stuff for windows and I prepare a bootable usb drive with the Windows OS on it. Plug the usb in the computer and install windows.

How to install MacOS on a clean & virgin hard drive so he can put the hard disk back on the Macbook and use it?

tl;dr: I need from Windows to install from an ISO or whatever, the Snow Leopard OS on a clean and new Hard disk, and put it back on a mac computer with the OS on it so it can start.

Layers of validation for clean architecture in .Net Core web application

For a clean architecture where there is presentation layer (Javascript), web api layer, application/domain layer, infrastructure layer (EF Core ORM). Let’s say it is an ATM system and the use case/function is Deposit. Imagine is a a web version although it doesn’t make sense.

After authenticated, user enter the input data which is the deposit amount. First validation happen in presentation layer using Javascript validation library. This input type validation will match with entity validation which defined in infrastructure layer (i.e. using FluentValidation). Example it will check the data type and input length. No business rules validation happens here.

Upon pass the ui data type validation, it will issue request to web api. If the request is available and valid, it will proceed to the application/domain for business rules validation. Example, deposit amount has to be positive amount, deposit amount has to be multiple of 10.

Upon pass the application/domain for business rules validation, it will move to infrastructure layer where this will be entity validation using for example FluentValidation to ensure input data again has the valid data type and length defined in the EF Core entity model.

So basically there are 4 layers of validation? UI -> Web Api -> Application/Domain/Business -> Infrastructure (ie EF Core ORM).

Domain-Driven-Design is not needed here. So, I combine Application and Domain into same layer.

Added extra thoughts: I realize that FluentValidation has extension for Web Api which means that the flow is better imo.

pgAdmin 4 restore ignores “Clean before restore”

I am using pgadmin v4.22 to backup and restore a database. This works fine the first time, but when I want to restore it again to a backup with deleting the old data, pgAdmin seems to ignore the Clean before restore setting. I end up with multiple identical entries.

This is what I am doing:
Right click on the database, and click on Restore...

Then I select myBackup.backup and set Role name to postgres.

In the Restore options tab I activate:

Sections: Data
Queries: Clean before restore

When clicking on restore, it succeeds in about 1.5 seconds for a 9 MB backup. This is the log:

pg_restore: connecting to database for restore
pg_restore: implied data-only restore
pg_restore: processing data for table "public.myTable"
pg_restore: executing SEQUENCE SET some_number_seq

It does not mention any clean step. When I query the database I have identical entries now.

gounlimited.to | The first and only SEO friendly player – Clean Ads – 24Hrs Payouts – Oldest video host since 2016 | Proxies-free

About

The GO Unlimited service, which may be known by the name of many of you, is one of the oldest services specialized in the field of video hosting. The goal of the service has always been to ensure the provision of a secure and stable platform for its long-term partners, in addition to providing features and characteristics commensurate with their aspirations and of course renewed development in order to ensure keeping pace with industry requirements.

GO Unlimited, 2020

In the year 2020, we seek to transfer the service from the field of traditional video hosting to integrated solutions in this field, by providing advanced tools, some of which were not previously proposed or used in this field, in order to keep pace with the development contained in this industry and its requirements.

————————————————————–

Our Goal

Our primary goal is to ensure the long-term stability of the platform and the stability of the services the tools it provides to its partners. We work in GO Unlimited on the basis of long-term plans and not short so as to ensure the opportunity to work for many years and successfully meets the aspirations and aspirations of our partners.

Our work since 2016 and our accomplishments are evidence of this goal that we seek. We will always continue to work on this goal.​

If you have any suggestions, or inquiries, we will always be glad to hear.