posted 17 years ago
Wow! You're joking, right?
Portlet preferences are user specific. A PortletPreference keeps information about a specific user.
PortletConfig is almost the exact same thing as the ServletConfig. It allows for setting a property that is common to ALL instances of that portlet.
So, if I have a CaliforniaStateTaxPortlet, I can set the tax rate to say, 6%, so everyone using that portlet would get their tax calculated at 6%. Someone might set their income in PortletPreferences. I set my income to $45,000. You set yours to $145,000. Someone else sets theirs to $200,000. That would be set in PortletPreferences - everyone has their own. But what is the tax rate for all of us? Well, it's still 6%.
Now, what if the tax rate goes down in California to 5%. Yea, I know that would never happen, but lets pretend. Well, you make ONE CHANGE in the PortletConfig, and it effects EVERYONE. I now pay 5%, you pay 5%, she pays 5%. BUT, our income hasn't changed in our PortletPreferences - it's completely unique to the user.
There's a HUGE, HUGE difference.
Here's the free tutorial on portlet development you absolutely need to see to understand the configuration objects:
Understanding the JSR168 Portlet Config Objects: PortletContext, PortletConfig, PortletPreferences, etc
Now, ask me about PortletContext..........
-Cameron McKenzie
[ August 09, 2007: Message edited by: Cameron McKenzie ]