Modeling "black box" data #77
markaddleman
started this conversation in
General
Replies: 1 comment 1 reply
-
Looking just at this small example I wonder why to wrap the id data under You could keep it flat, and infer the type at the same level, using the available data, like: (pco/defresolver object-type
[{:keys [physical.object/customer-id
physical.object/device-id
virtual.object/rule-definition-id]}]
{::pco/input
[(pco/? :physical.object/customer-id)
(pco/? :physical.object/device-id)
(pco/? :virtual.object/rule-definition-id)]}
{:object/type
(cond
(and customer-id device-id)
:physical
rule-definition-id
:virtual)}) In general, is better to keep things flat as possible. As an experience point, we had around trying to use generic ID's in Fulcro applications. They tend to not scale very well because they don't help to narrow the possibilities of the data to navigate. In contrast with more specific ids, that can go straight to the point (instead of having to try N possibilities because the current data isn't specific enough). |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
(from #65 (reply in thread))
Within my application, I have two objects which the UI should treat the same. As far as the UI is concerned, there are only two relevant attributes, a friendly name and an id. The id contains information which is "black boxed" to the UI. The server uses the ID info to identify which particular object it is.
For example, I an object which represents a physical object in the real world. From the UI's point of view, the object looks like this:
While I have some questions around Pathom and query planning, @wilkerlucio brought up a question of whether I'm taking a good approach to modeling the data. Any thoughts on this approach?
Beta Was this translation helpful? Give feedback.
All reactions