views:

264

answers:

4

We have a few projects that involve building an application that is composed of maybe 50% custom functionality, but then pulls in, say, a wiki, a forum, and other components that are "wheels" that have already been invented that we do not wish to re-write from scratch.

These third-party applications usually have their own databases, themes, and authentication systems. Getting things to work like a single-sign-on, or a common theme, or tagging/searching across entities in multiple sub-apps are pretty challenging problems, in my experience. What are some of the best practices for this kind of integration project?

Our approach, so far, has been to try and pick your components carefully, choosing ones that have a clearly defined API, preferably via HTTP (like REST or SOAP), though that isn't always possible (we haven't found a decent forum that works that way). Are there suggestions folks can give to anyone trying to do this, as I suspect many of us are more and more frequently these days?

A: 

Donald Knuth said that even better then reusable code is modifiable code, so if there is no API, you should seek for an open source app that is written well and therefore possible to customize.

As for databases and login systems and other programming parts (i don't see how e.g. theming could benefit), you can also try, depending on circumstances wrapping stuff so that module believes it's on it's own, but actually talks to your code.

Slartibartfast
A: 

If you are going with open source libraries, pick ones with a good license. I have found out the hard way (when trying to OEM an application) that many companies shy away from licenses like LGPL. I won't go into the details on why but they prefer Apache, BSD or MIT style licenses.

Pick tools that have been around for a while. Check out the community and make sure it is active. See what other people are using and use those tools.

Pick technologies that work well together. I've put together an application that uses ORM and Web Services. Spring Framework + Apache CXF + JPA for the ORM created a nice technology stack. All of the tools I use easily tie together in Spring making it easy to use them together. The last thing you would want to do is pick tools that you have to write a bunch of code just to use them together.

Pick technologies that are based on standards. That way if the library or tool dies, you can easily switch to another that uses the same standard.

Chris Dail
+1  A: 

Make sure that the interface between your application and the third-party application or library is such that you can replace it easily with something else just in case. In some cases the third-party software may just be an implementation of an standard API (Java does this a lot with JDBC, JMS, JNDI, ...). In other cases this means wrapping the third-party library in some API that you come up with.

Of course there are times to throw that idea out the window and have things tightly integrated with the third-party software. Just be sure that you REALLY want to bind your application to that third-party. Once you go down this road it's REALLY hard to go back and change your mind.

John Meagher
A: 

My approach has been to use third party code for some core functionality. For example, I use Subsonic for my data access, Devexpress components for UI and Peter Blum Data Entry Suite for data entry and validation. Subsonic is open source, Devexpress Peter Blum's controls have source code available for an extra fee. It would be impossible for me to get the functionality of these control if I tried to write them myself.

This approach allows me to focus on the custom functionality of my application without having to worry about how I will access the database or how I make an editable treelist that looks pretty. Sure I don't have a fully configured and working forum but I know that I'll be using a SQL database for my app and I won't have to try and get different data storage components to work together. I don't have a wiki but I know how to use the devexpress ui components and formatting and validating data entry is breeze with Peter Blum's controls. In other words, learn tools (and of course choose them carefully) that will speed development of all of your projects then you can focus on portions of your application that have to be customized.

I'm not too concerned if it's open source or not as long as source code is available. If it's open source I donate to the project. If it's a commercial component I will pay a fair price. In any case, the tools help to make programming fun and the results have data integrity and are great looking. If I develop a wiki or forum I know that I can get them to work together seamlesslessly. Finally, all of the tools I have mentioned have been around for a long time and are written by outstanding developers with great reputations.

Geri Langlois