I have a web app that has many differente user profiles. Let's suppose I have a page that shows a domain object, lets say a Car. I present 3 buttons for every user, for instance
- technical details
each button takes the user to a different page showing car specs, images and pricing respectively.
Lets say one of my user profiles is 'mechanic', and when this profile is logged on, I want to show some other buttons like 'engine specs' or so, but only for this profile.
Is there any easy approach on implementing profile-specific view options, without bloating the view code with if(profile)-then-addFeature, etc etc? I'm using servlets, I suppose constructing a hierarchy around the view servlet, where each subclass serves a profile should cut it, but I want to reuse the common stuff witouth too much hassle, and I want to provide a default behaviour that can be overrided.
I guess this must be a common problem, so I'm hoping for some comments :)