Fork me on GitHub

I find the docs here a little bit confusing. In the second point it suggests not to think of attributes as being "owned" by a particular entity, but in the following point it says to place the attribute in "a namespace most closely representing the concept/entity for the attribute". It's like the former suggests a many-to-many mapping between attributes and entities, while the latter suggests a one-to-many. My understanding is that a keyword can be interned to an attribute in multiple namespaces. Is that right? If so, perhaps this portion of the docs could benefit from a clearer distinction between interned attributes, which have a one-to-one mapping with namespaces, and keywords, which map many-to-one with attributes and are irrespective of namespaces.


Hey Alex, so, the general idea that I'm trying to get across is that identities is how you express "ownership", but the naming recommendation is just about finding the darn thing and preventing you from making duplicates.


The docs need tuning for sure. I think it should say "put the attribute in the namespace of the attribute...sort com.mycompany.model.person might be where I put all the attributes that I give the ns person to. It's just about easily making sure your model is clear/clean/easy to navigate. In general I don't recommend using generic attributes (e.g. :entity/something) for pragmatic reasons: they don't tend to perform well in queries (at least in Datomic)....but that's a db dependent bit of advice.


If you're using SQL and can create an index willy-nilly then you can make those perform just fine.


So, attributes, in RAD, are not "owned" so much as "can appear in entities identified by the following unique identity keys"


Thanks Tony. Reading ahead combined with your response, it makes a lot more sense now.


When I show form (via clicking on a report row), it always tries to load information from the backend, even if I already have the information loaded. Any way around that?


Write your own state machine for the form or report. Loading it is the right thing to do for many reasons: • the report may not have loaded everything the form needs • A long time may have elapsed between loading the report, and the user clicking on the form (the data you have is possibly stale) • The user could have had that form open in another tab, edited the object, and then clicked on it in the original tab...stale data again, but from a different context, and is confusing.


RAD will always be loading the form. Period. 😄


but everything in RAD is, use the fo/machine option and plug in your own behavior


maybe you've got a websocket and you're using some kind of server push sync to keep it up-to-date.


I’ll start with the usual case, optimize later as needed


And I have a fairly powerful caching mechanism with strong invalidation on server side if needed


Philosophy of RAD: Give you something you can stand things up with very rapidly, but don't get into the combinatorial explosion of an option for every possible need: instead make it easy to escape the provided things as needed (incrementally where possible). Behavior is a pluggable UISM. Rendering: just write your own body (it's just a defsc with helpers). etc.


I am trying to spice up my form title a bit with an icon, but it produces unwanted placement of form buttons:

fo/title (fn [_ {:keys [::m.user/name ::m.gen/email]}]
                (ui-icon {:name "user"})
                (dom/div :.content (str name " (" email ")"))))


seems like floating doesn’t work too well here


There are some SUI options you can tune to tweak classes, but the idea is that you can create your own automatic layouts if you don't like those supplied. You can always take control of rendering in many different ways (custom UI plugin, write the body of the component, etc.). The intention for RAD generated UI is to be "good enough" for internal use and maybe alpha...refinement is up to you.