-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dynamic Traits Cookbook #28
Conversation
This commit illusrates Dynamic Traits w.r.t. the Agents, respective properties and the shared lanes. Author: Aditya R Reviewers: Ajay G, Rohit B Test: Manual Issue: #24
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The dynamic traits look good from a code perspective. Couple of suggestions
-
It might good to have the logic of determining what trait to load based on the data passed into a lane, say
config
. You could call that withspace.command
and the payload can be aValue
with atype
key which may be "Water" or "Juice" . The callback function on theconfig
lane could load the appropriate trait based on the value of thetype
. That way you can remove the props in the recon file for/liquid/:id
-
Just the
sharedInfo
lane should be fine, not sure we need another `shared lane? -
Minor thing, maybe use proper agent names instead of random ints as ids.
/liquid/distilled,
/liquid/applesay. Also it might be best to have
/liquid/sparklingand
/liquid/orange` for the static traits to be consistent. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Checkstyle fixes
- LiquidAgent.java:
didStart
logs the word "region", which doesn't make sense for this app -- I'm guessing this is an artifact from cellular
Addressed (1) and (3). For (2) - cleaner lane sharing observed for static and dynamic, hence the two. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good other than the aforementioned comment.
@AdityaRandive The general pattern would be for the traits (i.e. Also having two lanes, one for sharing info of static traits and one for sharing info of dynamic traits, is a bit confusing. The main idea here is to show that you can have the same lane and use it across static and dynamic traits and share "info". That way downstream clients that access data from these agents can just subscribe to one lane i.e |
ACK |
This commit illusrates Dynamic Traits w.r.t. the Agents, respective properties
and the shared lanes.
Author: Aditya R
Reviewers: Ajay G, Rohit B
Test: Manual
Issue: #24