Coder Social home page Coder Social logo

Comments (2)

labordep avatar labordep commented on June 12, 2024

@ELePors don't hesitate to expose your ideas on this function to brainstorm on it.

from molecule.

labordep avatar labordep commented on June 12, 2024

Edit: this is a reflexion.
=> I don't find an use case when 'componentName' is not suffisant to deploy a component stack :/
May be this feature is a reflect of a structuration problematic and not to be managed by Molecule, but by the app designer.

An example of use:

I want to start MyComponentA implementation in two clusters.

Starting same component in two clusters:

component := MyComponentA startInNewCluster.
component componentName. "#default_cluster12542 (generated unique cluster name)"
component clusterName. "#cluster12542"

"another examples"
MyComponentA startInNewCluster. "default->cluster59634 (generated unique cluster name)"
MyComponentA startInClusterNamed: #clusterA. "default->clusterA"
MyComponentA startInClusterNamed: #clusterB. "default->clusterB"

Used this component in a ponctual cluster external component:

MyComponentAClient>>componentInitialize
self forServices: MyComponentAServices useProvider: (ComponentName default; clusterName: #cluster12542; yourself value). "need an object to build the key properly: ComponentName default; clusterName: #cluster12542; yourself value"

Used cluster deployment capacity inside a "clusterized" component.
=> Actual behavior, no changes. but in background check if the component belongs to a cluster:

MyComponentA>>componentInitialize

"starting some sub-component (used when a Component tree is deployed)"
MyComponentBServices start: self componentName. "component used as a cluster => #myKey_clusterX"
MyComponentCServices start. "common component used by all components: warning it is necessary to test before is this component is not already started (dirty example)"

"using sub components"
self forServices: MyComponentBServices useProvider: self componentName. "component used as a cluster => #myKey_clusterX"
self forServices: MyComponentCServices useProvider: #default "common component used by all components, not necessary to write this line, this is for example illustration (explicit)"
MolComponentImpl>>componentName
"return the cluster name or the component name"
^ self cluster ifNil:[ componentName "#componentName" ] ifNotNil:[ :c | 
        ComponentName name: componentName; clusterName: c name; yourself value
]
MolComponentImpl>>clusterName
"return the cluster name"
^ self cluster ifNotNil:[ :c | c name "#clusterXXX"]

from molecule.

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.