Giter VIP home page Giter VIP logo

justdi's People

Contributors

ruban-gt avatar

Watchers

 avatar  avatar

justdi's Issues

Container sub-modules

Implement container sub-modules like this:

sub_module = Justdi::SubModule.new do |register|
  register.call(:schema).use_class(Graphql::Schema) 
  register.call(:server).use_class(Graphql::Server)
end

container.import_module(sub_module)

Global container

Think about definition of the global justdi container for the whole ruby application without manual initialisation.

Self-definition

Think about ways to provide self contained definitions like as it was implemented in Angular.

Concepts

Concept A

class ComponentA
  extend Justdi::Component

  component do |metadata|
     metadata.imports ComponentB
     metadata.store SomeDefinitionStore
     metadata.provider(
       key1: { resolver: ->() { 42 } }, 
       key2: { use_class: Custom }
     )
  end
end

container.import_module ComponentA

Concept B

class ComponentA
  extend Justdi::Component

  component_metadata( # probably another name, idea about the single method
     imports: ComponentB,
     store: SomeDefinitionStore,
     provider: {
       key1: { resolver: ->() { 42 } }, 
       key2: { use_class: Custom }
     }
  )
end

Concept C

class ComponentA
  extend Justdi::Component

  component_imports ComponentB
  component_store SomeDefinitionStore
  component_provider key: { use_class: Custom }
end

Summary

The first approach (A) will be more flexible helping to avoid any conflicts.

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.