Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

206
Visualizações
What domain driven design mean for Javascript applications on the client side?

What domain driven design mean for Javascript applications on the client side?

I want to build an application based on ddd approach with javascript.

The framework I'll use to implement the application is not important to me because I want to learn how to organize the code according to ddd architecture.

Let's decide module is folder.

My application is have login, notifications, reports, crud operations, and shared stuff, and each of them have api-server logic, ui components, services and crud.

For example auth folder contains the following

 api               --> server logic
 domain            --> the domain itself. the bl: handle the data, use of http.
 feature-login     --> the page itself containers of ui elements. 
 feature-register  --> the page itself containers of ui elements.
 ui                --> ui elements for auth domain
 utils             --> utils functions for auth domain

same goes for notification folder:

 api               --> server logic
 domain            --> the domain itself. the bl: handle the data, use of http.
 feature-create    --> the page itself containers of ui elements. 
 feature-list      --> the page itself containers of ui elements.
 ui                --> ui elements for notification domain
 utils             --> utils functions for notification domain

And reports:

 api               --> server logic
 domain            --> the domain itself. the bl: handle the data, use of http.
 feature-dashboard    --> the page itself containers of ui elements. 
 feature-search      --> the page itself containers of ui elements.
 feature-edit      --> the page itself containers of ui elements.
 feature-view      --> the page itself containers of ui elements.
 ui                --> ui elements for report domain
 utils             --> utils functions for report domain

This is how I build my application.

So Where is my problem here?

According to ddd the domain is shouldn't be share inside other domains. because it's create decoupling.

But in the report domain I need to get the user from auth domain and need to display notification from notification domain.

This is makes decoupling between the domains.

So it's lead me to realize maybe I don't defined my domain correctly? my folder structure is matching the ddd principle? if no how I do I decide what is domain and what is not?

about 4 years ago · Santiago Trujillo
2 Respostas
Responde à pergunta

0

DDD does not say that you can not access an entity from another entity.

You should group your entities by aggregate and identify the root aggregate.

The root aggregate will be then use in order to access the entities.

The presentation layer will acces the domain via an application service.

about 4 years ago · Santiago Trujillo Relatório

0

The problem is that here you are doing a technical cut and not a business cut.

In DDD, before moving on to the code phase using tactical patterns, there is a strategic phase.

In this strategic phase, thanks to a business expert, you will be able to use the different strategic patterns: Ubiquitous language, division and identification of sub-domains, strategy around Bounded Context.

Without this phase, you do what we call "DDD lite" and one of the problems linked to this is the one you raise.

Ok to have separated your auth domain (authentication is almost always a generic sub-domain) but why did you separate your notification and report sub-domains? Are you sure this is the right decision?

If you want to practice without a business expert, maybe you should do a mini Event Storming first?

about 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda