Giter VIP home page Giter VIP logo

angular-clean-architecture's People

Contributors

coffeeandcloud avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

angular-clean-architecture's Issues

Feat: Reduce custom providers in App.module.ts

Hi first of all thanks for sharing your approach.

I think we could reduce the custom providers in the app module such as :

{provide: ElephantRepository, useClass: ElephantMockRepository}

By using either config being passed in a forRoot static method (that ensures typing for provided classes ) or ConcreteImlementationModules .

// app.module.ts
...
import { elephantMockRepositoryFactory } from './data/repository/elephant-mock-repository/elephant-mock.repository';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    DataModule,
    CoreModule.forRoot(elephantMockRepositoryFactory),
    PresentationModule
  ], 
  bootstrap: [AppComponent]
})
export class AppModule { }


// core.module.ts

CoreModule {
   static forRoot(factory: () => ElephantRepository ) {
      return {
         ngModule: CoreModule ,
         providers: {
            provide: ElephantRepository, useFactory: factory
         }
      }
   }
}

Or

// app.module.ts
...
import { elephantMockRepositoryFactory } from './data/repository/elephant-mock-repository/elephant-mock.repository';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    DataModule,
    CoreModule,
    PresentationModule,
    MockModule
  ], 
  bootstrap: [AppComponent]
})
export class AppModule { }


// mock.module.ts

@NgModule({
...
 providers: [
    {provide: ElephantRepository, useClass: ElephantMockRepository}
 ]
...
})
MockModule {  ... }

Even more we could move it to the environment files removing any reference from mocks:

// environment.ts
export const environment = {
 ...
 modules: [
    MockModule
 ] 
 ...
}

// environment.prod.ts
export const environment = {
 ...
 modules: [
    ConcreteImplementationModule
 ] 
 ...
}

// app.module.ts

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    DataModule,
    CoreModule,
    PresentationModule,
    ...environment.modules
  ], 
  bootstrap: [AppComponent]
})
export class AppModule { }

Domain validation rules

What about the domain validation rules? How to integrate Angular Form Validation with the domain model without break the DRY principle?

Dúvida

Olá.
Primeiramente, parabéns por este projeto que ajuda a clarear bem as orientações da Clean.

Entendo que Rxjs é um detalhe. Por outro lado useCase pertence de certa forma ao dominio da apliçao. Nesse sentido, como pertencendo a uma camada mais interna, useCase não poderia "conhecer" Rxjs que é de camada externa.
Pergunto: Na linha 1 em que temos useCase dependendo de Rxjs fere a clean architecture?

https://github.com/im-a-giraffe/angular-clean-architecture/blob/b0ac9c3c3989ce954c501523238383671d9f93b9/src/app/core/base/use-case.ts#L1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.