I'm struggling to understand the value of Popup and how you use PopupDefinition with a FeatureLayer or FeatureTable to customise the display of feature attributes on mouse events.
What does PopupDefinition do that isn't covered by Feature.attributes?
The problem I am trying to solve is displaying feature cards in response to mouse-over or mouse-click events in the map view.
In other frameworks I have subclassed or decorated the equivalent of Feature to retain a reference to the view model for the feature being displayed, which I then get back in hit detection (identify) results and I then ask the feature or its factory to return an instance of its callout view.
So far in arcgis-runtime-sdk-java I have tried populating the non-extensible Feature's attribute map and retrieving these attribute values from the GeoElements returned in IdentifyLayerResults. This though requires hard-coding specifics about what FeatureTables contain what types of application features in multiple places and relying on string-bashing to marshal values in and out of attribute maps, rather than simply initialising the callout views with the domain types they represent. This all yields code that couples my code to internal details of ArcGIS, global constants littering the codebase and Map<String,Object> data representations that fight type-safety and will be a PITA to maintain.
When I discovered the existence of PopupDefinitions and that these could be defined per layer/table I thought I could use them to address at least a couple of these issues, defining the callout card implementation selection at the point the layers are created, but on trying to actually use them it looks no different to setting the attributes on the feature.
How do the authors see these thing actually being used? There is little in the way of descriptive documentation on Popup and only a very simple HelloWorld-level example of Callout presentation.