Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

PortletService

 
Dorothy Taylor
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I want to know what is the IBM PortletSErvice and when it should be used. According to what is given in Infocenter, it is used to provide common functionality to portlets. But what is that common functionality. Can someone please provide some examples of the scenarios in it can be used.


Thanks
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As we know, portlets can't very easily share data. You can use the PortletSession's Application scope, but even that only works amongst portlets in a common jar file.

Perhaps there is some functionality that all of the portlets in your domain need, perhaps a user profile lookup, or access to a PeopleSoft or other enterprise system that can't be easily accessed within a portlet. Making a resource like this available through a PortletService allows all portlets running on a given server, regardless of how they are packaged in war files, common access.

Simple database tables, access to enterprise resources, security information, connections to old systems where access is difficult - all of these needs can be addressed by providing commonly needed functionality through a PortletService.

-Cameron McKenzie
 
Dorothy Taylor
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So if it is an enterprise application or connection to some legacy system etc., it is ok..but you have also mentioned database tables. Why would we need PortletService to talk to back-end database from PortletService then? We have other J2EE Design patterns for doing that like Business Delegate and Service LOcator. Can we not make use of these?
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There's no problem using those patterns at all. But if you've got 10 portlets that need a particular resource, and access to that resource is mitigated through one of those design patterns you mentioned, do you want to re-code that design pattern or implementation in each portlet?

With a PortletService, you can code that implementation once, and then share it across all of the portlets in your enterprise. Any portlet, in any war, could call the PortletService with relative ease. The code is created once, and maintained in a single location, which would be outside of the portlet itself.

The question that's often asked in these forums is how to share data or functionality across portlets, or even how do you do something in a theme, and make that accessible in a bunch of portlets. Quite often the answer is "you really can't, but with IBM, you can do it through a PortletService."

-Cameron McKenzie
 
Dorothy Taylor
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So does it mean that if we have a PortletService, then there will be no need for a Delegator. All the calls to the business service, can actually be moved into a PortletService and hence all portlets can access them?

Also if we create an ApplicationClient Project(in RAD 6.0). This project can have the Business Delegate and the ServiceLocator. The AppClient.jar can be placed in shared\app folder of POrtal Server. In that case too, all the portlets on the page, will have access to the Business Delegate and Service locator. And then they can communicate to the database and read/write teh tables by calling the exposed methods from teh delegate
[ May 14, 2008: Message edited by: Dorothy Taylor ]
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to know what is the IBM PortletService and when it should be used.


So, now we're getting away from the simple discussion of what the PortletService is, and into a whole discussion of application design and implementation.

I think all of what you are suggesting is valid. The PortletService is a Godsend when it is used properly. Having said that, I'd hate to see the ship steered too much in the wrong direction. I mean, you could potentially turn everything into a PortletService, and that would cause more problems than it would solve.

I think the term 'service' is really key. This component can help you develop a service oriented architecture using portlets, in a way that fits very naturally with the WebSphere Portal Server. I often see portlets doing too much. I think if you can figure out when to use a PortletService properly, it will help make your design more elegant and more service oriented.

-Cameron McKenzie
 
Dorothy Taylor
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So does it mean that it is a service like Credential Vault? I was just checking the URL: http://www.skywayradio.com/tech/iSeries/wps/wpsadvdev.html
Here it has been explained how to connect to legacy system or lotus server etc. using the Credential Vault.

I mean, is Credential Vault a kind of PortletService then? Can you pleaes suggest some other scenarios where we can use the PortletService, something that cannot be provided with the normal J2EE design patterns
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah, I think the Credentials Vault is just that - a PortletService, but one that IBM provides out of the box.

But if you looked at IBM's implementation, that Credentials Vault probably uses a bunch of Design Patterns. It's not a replacement for a design pattern, but instead, a unified mechanism for service access. Almost think of it as a global service locator, but designed specifically for portlets.

-Cameron McKenzie
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic