Coder Social home page Coder Social logo

Hierarchy about minim HOT 5 CLOSED

smizell avatar smizell commented on August 20, 2024
Hierarchy

from minim.

Comments (5)

fosrias avatar fosrias commented on August 20, 2024

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.

smizell avatar smizell commented on August 20, 2024

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.

fosrias avatar fosrias commented on August 20, 2024

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.

smizell avatar smizell commented on August 20, 2024

@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.

kylef avatar kylef commented on August 20, 2024

This was solved by #141.

from minim.

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.