Comments (5)
Hm. Not sure that an element needs to know its parent. Why? It introduces unnecessary coupling doesnβt it?
On Feb 17, 2015, at 6:21 AM, Stephen Mizell [email protected] wrote:
Elements should know of their children and their parents.
Which brings me to a question I have. An ObjectType is basically a collection of PropertyType elements (which are essentially key-value pairs). To have the same format, and potentially help in future features, should ArrayType collections consist of some kind of IndexType that instead of having a key, it has an index.
Reason being, an element needs to know where it is in the tree of elements, and without this having an explicit element (like IndexType), it would need to know the index for itself as well. If it did have this IndexType, it could know the array that it is in plus it's location without storing that.
Hope that makes sense.
@fosrias https://github.com/fosrias @zdne https://github.com/zdne
β
Reply to this email directly or view it on GitHub #17.
from minim.
The benefit would be that you could pass around parts of the element tree and still know the context of that element. It would also allow for more complex lookups, like finding all elements with such-and-such attribute where the parent element is of such-and-such type.
from minim.
I am not sure this should be accomdated but the structure, but rather every element just having a parent property that is dependency injected when instantiating the wrapping class, no?
On Feb 17, 2015, at 7:03 AM, Stephen Mizell [email protected] wrote:
The benefit would be that you could pass around parts of the element tree and still know the context of that element. It would also allow for more complex lookups, like finding all elements with such-and-such attribute where the parent element is of such-and-such type.
β
Reply to this email directly or view it on GitHub #17 (comment).
from minim.
@fosrias Exactly. This parent relationship will not be handled by the Refract data structure, but rather by Minim. It is internal to element instance.
from minim.
This was solved by #141.
from minim.
Related Issues (20)
- Rename array `contains` to `includes` HOT 1
- JSON06Serialiser is not able to serialise frozen elements HOT 1
- Delete certain elements from array element HOT 3
- `find*` methods should return optional element
- Support for traversing upwards in an element in a tree
- An in-range update of watchify is breaking the build π¨ HOT 2
- An in-range update of mocha is breaking the build π¨ HOT 5
- toEmbeddedRefract HOT 7
- Feature request: move project to TypeScript HOT 1
- Add remove method
- Handling Circular Structures HOT 1
- Better handling of undefined HOT 1
- Follow semver rules? HOT 5
- Error Handling
- Minim 1.0.0 HOT 5
- Serialization Formats HOT 1
- Should children be recursive? HOT 2
- Broken for refracted element in meta HOT 3
- Add compact refract as a format HOT 1
- Merge dredd-transactions' refract.coffee with Minim HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from minim.