A question of best practice for Palantir Foundry Ontology: So if you’re working on editing a singular item, say Customer, then you can do it all in UI: a field for name, some fields for contact info, etc, submit. Those do not need to be stored as we’re editing and only get created in an object on submit.
This is a question of in-progress objects, and I can’t find a similarly good solution for object types with parent-child relationships. They seem to want to be stored in a temporary state, which induces a tradeoff:
Take Order and Order Item. We need to group all Order items under a given Order. So a primary key / unique id is needed. We need to make sure that order is available and would like to reserve it so no one else can use it (especially if using sequential keys). It seems like we should create an Order object and associate Order Items with it on submission.
And we want to display Order Items in a table and provide easy ways to add / remove them. Palantir offers this functionality, but only do so on objects that have been added. So we’d like to make use of that. It seems like we should create the Order Items and use the ontology functionality to enable the UI functionality.
But now we have a small but real added complexity that we pass downstream. There must be a way to distinguish between objects in progress and completed ones. There are basically 2 ways and I’m not completely happy with either:
-
Create a status column. Setting aside that status could mean many things (I last used “Is Active” ), now we must have that property on anything we want to submit. And downstream has to remember to respect that, which could easily be overlooked.
-
Create a draft version of the object type. This is cleaner and does not impose the burden of checking for a column, but pollutes the ontology with draft duplicates. There’s a notion of using interfaces which could standardize fields between draft and actual (they both must have the interfaces columns). This has upfront complexity.
I have spent much longer than I would like or like to admit thinking about the pros and cons, and I come away unsatisfied. Is that just the nature of the beast or am I missing something?