Code Monkey home page Code Monkey logo

di-hub's People

Contributors

nayjest avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

velzinik

di-hub's Issues

Possibity to specify external dependencies in internal hub

Example: '@' means that item2 placed in outer hub.

$hub->addDefinition(new Relation('item1', '@item2', $callback));

Impl. details: SubHub should remove relations with ext. dependencies from internal hub and add corresponding relations to external hub.

Todo: Define behavior when multiple external hubs available

Implement CompoundDefinition

CompoundDefinition is abstract class that can add multiple items to hub.

Requirements: possibility to remove CompoundDefinition from hub

Implement Definition\Item flags

Possible flags:

1. Value::FLAG_PRIVATE
private item

Behaviour:

  • $hub->has() == true
  • $hub->get()/set() must throw exception

Use-case:
implementation of internal items for multi-source relation definitions, see #3

2. Value::FLAG_IMMUTABLE
Value can't be changed via relations or $hub->set()

Behaviour:
Throw exceptions when trying modify item via $hub->set() or when value is used as target in relations.

Use-cases: useful when it's prohibited to modify or replace item during app lifetime

3. Value::FLAG_NOT_INITIALIZED

Draft, not implement it, design it first. (TODO)

$hub->set() should be called at least once

Find the way to maintain consistency when item should be replaced from relation

Case:

We have hub with $item and two dependencies: $a, $b.
Relation [a --> item] replaces $item instance (or makes $item->b not actual in any other way).

Relation [b --> item] should be always processed after calling `$hub->set('a', some_value)`.
Relation [b --> item] should use instence created in [a --> item]

If it's possible with current Di-Hub architecture, document solution.

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.