DEV Community

Cover image for Core Entity num Sistema Modular em Golang

Core Entity num Sistema Modular em Golang

Conceitos

  • Módulo: Agrupamento de funcionalidades relacionadas a um componente de um software.
  • Core Entity (Entidade Central): Núcleo ou base de funcionalidades de um módulo.
  • Feature (Funcionalidade): Acção, operação ou regra de negócio relacionada à entidade.

Estrutura

  • O sistema é composto por Módulos.
  • Um módulo é composto por Core Entities.
  • Uma Core Entity é composta por Features.

Hierarquia

Sistema Modular
├── Módulo
│ ├── Core Entity
│ │ ├── Feature
│ │ └── Feature
│ └── Core Entity
└── Módulo

Cenário

Se um sistema possui os módulos de Autenticação e Configuração, as entidades centrais podem ser:

  • Autenticação: Usuário, Perfil, Permissões, Usuários por actividade, etc.
  • Configuração: Configuração Básica, Configuração de Email e Configurações da Empresa.

Sugestão

A inicialização das flags para as entidades centrais pode ser feita pela base de dados.

Essa abordagem permite maior flexibilidade, facilitando alterações e a adição de novas entidades centrais sem modificar o código directamente.

Código-fonte: https://github.com/ortizdavid/golang-modular-software

Image description

Image description

Image description

Image description

Image description

Image description

Image description

Image description

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

Top comments (0)

AWS Security LIVE!

Tune in for AWS Security LIVE!

Join AWS Security LIVE! for expert insights and actionable tips to protect your organization and keep security teams prepared.

Learn More

👋 Kindness is contagious

Explore a sea of insights with this enlightening post, highly esteemed within the nurturing DEV Community. Coders of all stripes are invited to participate and contribute to our shared knowledge.

Expressing gratitude with a simple "thank you" can make a big impact. Leave your thanks in the comments!

On DEV, exchanging ideas smooths our way and strengthens our community bonds. Found this useful? A quick note of thanks to the author can mean a lot.

Okay