Sunday, August 21, 2005

Websphere Business Integration Modeler notes

Notes from reading an article on WBI Modeler

Article is at: http://www-128.ibm.com/developerworks/websphere/library/techarticles/0502_mitra1/0502_mitra1.html

 

High level steps for creating a business models are as below:

 

  Creating a business modeling project.

  Creating the business items.

  Creating the process model (that involves identifying the individual tasks and defining their inputs and outputs).

  Creating the process flow by connecting the tasks together (as sequential or parallel steps).

 

 

Notes from reading documentation on WBI 5.1.1 on infocenter

 

Models are organized into folders which are referred to as catalogs.

 

In the same project multiple data catalogs/resources/organization/report/process can be created and they can also be nested.

 

Both processes and tasks represent activities that are performed in a business. Processes are more complex than tasks, however, and can be represented as a sequence of activities that are linked by flows of control and data. This sequence as a whole is known as a process flow. By contrast, tasks are atomic activities that cannot be divided into smaller actions. For example, Payment Handling is a process made up of three tasks: Input Customer Information, Input Customer Order, and Obtain Product Availability

 

The difference between a merge and a join is that in merge as soon as an input is received it is sent as an output where as in join it waits till all the inputs are received.

 

A single process can have multiple start nodes.

 

A stop node marks the end of a process. Every process, subprocess, and loop must have at least one stop node. When a flow reaches a stop node while the process is running, the process immediately terminates, even if there are other currently executing flows within the process.

 

Tasks are the basic building blocks representing activities in a process model. Each task performs some function. Visually, a task represents the lowest level of work you can portray in a process.

 

There are two types of tasks: local (specific to the process) and global (reusable within a project). A local task is owned by a process and can only be used by elements within that process. The task exists only while the process exists. A global task is a top-level task that you create in the Project Tree within a process catalog. It can be used by multiple processes within the project.

Sunday, July 17, 2005

How to handle logging in portlets?

There are several ways to go about this and one can choose the approach according to ones taste and organizational standards.

At high level below are some of the logging options.

1. Good old System.out but use this only during initial development phase. Plan on converting this to some logging framework as soon as possible. You can either do global replace all or use a free eclipse plugin, log4e, to convert to log4j statements.

2. Jakarta Log4j which seems to be the industry standard.

3. JDK 1.4 logging apis.

4. Simple Log from java.net

5. Websphere logging apis which is my preference.

There must be several more open source, vendor propritery, and in-house developed logging framework.

I will continue with this article with my experience on using log4j, system.out and websphere apis as soon as i collect my thoughts on this.

Wednesday, July 06, 2005

top 10 architecture books

I had initially added this list based on an article in software development journal for my note. Since than based on a feedback I have extended the list. Clicking the link takes to amazon's web site.

  1. Agile Software Development with SCRUM (Paperback)by Ken Schwaber, Mike Beedle

  2. Software Requirements, Second Edition (Paperback) by Karl E. Wiegers

  3. The Mythical Man-Month: Essays on Software Engineering, 20th Anniversary Edition (Paperback) by Frederick P. Brooks

  4. Software Factories: Assembling Applications with Patterns, Models, Frameworks, and Tools (Paperback) by Jack Greenfield, Keith Short, Steve Cook, Stuart Kent, John Crupi
  5. Domain-Driven Design: Tackling Complexity in the Heart of Software by Eric Evans (Hardcover)

  6. Beyond Software Architecture: Creating and Sustaining Winning Solutions (Paperback) by Luke Hohmann
  7. Agile Software Development, Principles, Patterns, and Practices (Hardcover) by Robert C. Martin

  8. Software Architecture Design Patterns in Java (Hardcover) by Partha Kuchana

  9. Documenting Software Architectures: Views and Beyond (Hardcover) by Paul Clements, Felix Bachmann, Len Bass, David Garlan, James Ivers, Reed Little, Robert Nord, Judith Stafford
  10. Pattern-Oriented Software Architecture, Volume 1: A System of Patterns (Hardcover) by Frank Buschmann, Regine Meunier, Hans Rohnert, Peter Sommerlad, Michael Stal, Peter Sommerlad, Michael Stal

  11. Design Patterns by Erich Gamma, Richard Helm, Ralph Johnson, John Vlissides

  12. Refactoring: Improving the Design of Existing Code by Martin Fowler, Kent Beck, John Brant, William Opdyke, Don Roberts
  13. Patterns of Enterprise Application Architecture by Martin Fowler

Saturday, May 28, 2005

jsse tips

1. To add public key to keystore from certificat file (*.pem, *.der, *.cer) is as below:
keytool -import -alias myalias -file certfile -keypass passwd -keystore storename -storepass passwd

2. To start a java client with debug info is:
java -Djavax.net.debug=ssl -Djavax.net.ssl.KeyStore=storename -Djavax.net.ssl.trustStore=storename javaclient


3. Use the below java code that works with point #2 above.

SSLSocketFactory factory = (SSLSocketFactory)SSLSocketFactory.getDefault();
SSLSocket socket = (SSLSocket) factory.createSocket("localhost", 443).

rest of the code is standard to get output stream and use buffered reader.

4. an alternate approach is at javaworld article

Sunday, May 15, 2005

IBM portlet programming interview questions

What is the difference between a servlet and a portlet?
Portlet is basically an extension of servlet but with some fundamental differences like a web page can consist of mulitple portlets but can have only single servlet, portlets cannot do browser redirect but servlet can.

What are the similarities between a servlet and a portlet?
Portlet is a an extension of servlet, can write html output, can forward but within the same portlet context, access to HTTP objects like session, request, response, along with similar Portlet objects like session, request, response.

What is WSRP?
Web Services Remote Portlet.

What are the different approaches for logging in portlet?
Websphere log apis, log4j, custom logging, jdk1.4 log apis and any logging framework should work just as well.

What are the different approaches for managing environment specific configuration?
Properties file, portlet attributes (configured via the config-param in portlet.xml).

Difference between abstract portlet and concrete portlet?

Explain struts portlet. How to create one?
Create a struts standalone web app and convert to portlet. There are 8-10 steps to do so.

Explain JSR168 portlet. How to create one?
Use WSAD wizard.

What is the difference between HTTPRequest and PortletRequest?
HTTPRequest is for the entire portal page and portlet request is abstracted out of HTTPRequest and is unique per portlet. As best practises portlet code should use PortletRequest object.

Should you use class scoped variables in portlet?
No, single instance of portlet in the JVM and so can cause data corruption if variable values are changed. However, no harm in using "final static" singleton kind of variables.

Can you do browser redirects from the portlet?
No, only forward.

What does the tag <portletApi:init /> do?
Initializes portletRequest, portletResponse, etc on the page.

What are the different portlet states?
Maximize, Normak, Minimize.

What are the different portlet modes?
View, Edit, Configure, Help.

Portlets execute in two steps, what are those?
Action and render in portal 5.0. There is a new phase IStrutsPrepareRendor introduced in portal 5.1 to address browser refresh, back, etc issue.

How to access external systems from portlet code like database, credential vault, and ftp server?

What is portal service?

patterns

There is pattern everywhere or should we say everything is a pattern. It is patterned that mango seed will grow into a mango plant, baby into a grown up, and so on. These patterns exist in nature. We also tend to do things in pattern, cars are mass produced in patterns, we invented patterns to build buildings and bridges. There are also patterns in the software world like Facade and DAO (Data Access Object).

But it looks like that sometimes there could be anamolies in the patterns. The patterns may not be perfect, there may be disadvantages, or they may not be just right. In the software world there is something called anti-patterns. Sometimes in nature we see malformed plants and animals which does not seem to conform to intended behavior of pattern.

Wednesday, November 10, 2004

Kapow Robots

I am using Kapow to create 'web clipping robots'. It is kind of neat as Kapow lets you clip any page and then out of the box you can create IBM Portal 5 portlets. You can also create portlets for BEA portal 8.1. I was able to successfully create 3 IBM portlets. These were created as .war files and I was able to install them seamlessly in our test environment. We had RoboServer also running in the background and it looked like it was all set. However the portlet contents were empty. Troubleshooting revealed that Kapow also creates a .robot file for every web clipped content and they needed to be installed under the "{KAPOW_HOME}|projects" folder.

By the way linux version of Kapow provide "RoboServer" and "RoboServerService" as runtime component. Use RoboServer, I am not sure what RoboServerService is as it was not doing anything.

Friday, November 05, 2004

notes on ibm portal 5.02

I am currently working on IBM portal v5.02. At first glance this looks like way behind BEA portal 8.1 but looks to be very stable and deploying a new portlet is much easier (just export as a war file). Below are some of the notes that I found useful while reading on IBM portal.

Usually, many portlets are invoked in the course of handling a single request, each one appending its content to the overall page. Some portlets can be rendered in parallel, so that WebSphere Portal assembles all the markup fragments when all the portlets finish or time out. Portlets that are not considered thread-safe are rendered sequentially

WebSphere Portal provides discoverable services for its credential vault, for managing persistent TCP/IP connections, and for managing the WebSphere Portal content repository.

WebSphere Portal includes the Document Manager portlet application for contributing and sharing documents between users. Document Manager provides a simple method for storing, navigating, viewing, and searching documents and other content.

By defining the transcoding PortletFilter on a portlet, the portlet HTML output can be converted to WML or cHTML, depending on the device that is making the request

The WebSphere Portal page aggregation subsystem supports several markup languages and recognizes certain browsers and mobile device user agent signatures, all out of the box. The framework is easy to extend to support additional markups or new devices.

The default set of user profile attributes is based on the inetOrgPerson schema, which is supported by most LDAP directories. The user repository might consist of multiple data sources.

The mapping of user profile attributes to LDAP object classes is defined using in the file wms.xml.

The file attributeMap.xml specifies the details of how each attribute is mapped to the LDAP directory or database.

After determining the identity of the user, the portal server consults locally cached access control lists to determine which pages and portlets a user has permission to access.