At my new job I'm forced to use Adobe AEM and everything that comes with it. But because everything is new to me and to my team, we are having some major dificulties understanding what are the best practices and what's the correct "code workflow". I've read everything that I could, but something's messing with my head and I just can't figure it out alone.
My question is: When I don't want to work with the JCR tree, and I just want to make a component for a specific user (not a real CMS component, I guess), I can't understand how I'm able to reload my component information (based on some Model).
So... imagine I have an authenticated user that has N Cars. And I've developed a component that shows the information of one of those Cars. The selected Car can change and I want to update the component with the selected Car information.
By default, when the page loads, the Car number 1 is loaded.
First question: How should this first Car be loaded? My first try on this one was to backup my component with a WCMUse extension, and on the activate() method I would set my default Car properties.
But this seems odd to me, because I don't know how I connect this class to my Spring Controller...
I've read that ResourceModel can be used for this, but that it would map its properties to a Car JCR node that I don't have.
Second Question: Imagine that the first Car is correctly loaded and I call a method on my Spring Controller to update it. What needs to be done to reflect this change on the Car information component?
So, to finish, I guess my main 2 problems are: What should be the model for the Sightly component, and how does the component refresh with the updated information.
Thanks a lot.