Giter Club home page Giter Club logo

Comments (2)

eirrgang avatar eirrgang commented on August 25, 2024

I think the steps we have will ultimately be preferable, but with some name changes and with more conventional application of the Builder pattern. When a Session is being prepared, the Context can provide a GraphBuilder object (currently an empty graph is provided) to each of the operation Directors (currently described as "element builders"). When the client code (via the Context enter() call) calls the construct() method (currently confusingly called build()) on each director, the director interacts with the graph builder. When the GraphBuilder's build() method is then called, we have a natural place for the current launch() call as an API hook available to the graph nodes. The remaining run() method (maybe more appropriately evaluate() or even visit()) is the interface for the graph execution Visitor pattern.

Our protocol allows Directors to subscribe to each other according to Element dependencies. This allows the interactions and data flow between graph nodes to be decoupled from the Context implementation (when possible). We will probably want a good way for the Context to intervene, though, or to mediate these bindings, so we should keep some abstraction in mind. This is informed by discussion in #62 .

During the graph building phase, as each Director is initialized, it is passed by the Context to the add_subscriber() method of its dependencies. The Context should provide a map of the input ports of the subscriber and the output ports of the provider as specified for the work, but the basic point is that the subscribing directors are stashed for use during the construct() call. During construct(), each director provides its subscribers with a way to access a bind() method for the objects being added to the graph, after passing its own new object to the bind() methods of its dependencies. The object binding is a chance to register factory functions if the binding needs to be completed with new objects during launch().

We currently use bind() for the elements providing the restraint calculation interface. For other more generic input / output relationships, we are stashing functors in the workflow Resources object provided to the plugins. The Resources object currently gets created during the construct() (currently build()). The upstream object calls the stashed functor to trigger a data event on the associated graph edge.

Some more experimentation with edge types and work elements should help to clarify how the above should be refined.

from gmxapi.

eirrgang avatar eirrgang commented on August 25, 2024

Tasks in support of this issue include #47 and #78

from gmxapi.

Related Issues (20)

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.