TECH-D13: Should I write my own Builder? Increase productivity by identifying and capturing repeatable design patterns within Web Experience Factory
David Wade, Davalen’s Web Experience Factory Architect
Adam Kewley, Web Experience Factory Lead, Davalen
Description: Writing efficient code in a modular fashion is a fundamental concept in developing quality software that must grow and change as business dictates. Capturing key components for reusability enables your developers to capitalize on shared knowledge through proper use of repeatable design patterns. This session is geared towards IT managers, architects and developers who wish to not only learn how to properly capture design patterns in IBM Web Experience Factory (WEF), but when to spot the need for such mechanisms. Utilizing existing techniques and features within WEF to generate your own library of repeatable functionality. Only available at the IBM Exceptional Web Experience conference, learn from a seasoned lead architect with applicable world-class practical knowledge.
Some topics covered will include:
Breaking down code reuse: builders, models, ljo's (what is this...)
Identifying reuse areas at a project level
How to decide between a builder and a model
Other areas of code reuse (data retrievers, LJO's services)
Pitfalls to avoid
Today's discussion will be focused around code and resource reuse through various means in a given WEF project. There also may be some talk about builders. I'm not going to lead anyone on until the very end to answer the original question, so I'll start with a summary. Should I be writing my own builders? Possibly. I find that only about 10% of the time am I actually writing a builder. There.. mystery solved. You can get up and leave now if you'd like. Builders can be very simple or very powerful. One could look a them as nuggets of modified and time tested code that may not fit your individual need 100% but will be (almost) guaranteed to run across multiple browsers and platforms, with a good deal of bugs shaken out. Remember that when considering writing your own builder. If you're looking for the one-size fits all solution, there will be several aspects that you may be missing. Writing new builders can introduce a whole new set of problems. Remember that when you go to think about writing one.
#1 I need to do something that isn't easy to do otherwise in a model. For example. ***REPLACE*** builders actually allow you to modify the contents of a page during model generation. Data Page based builders may be modifying the schema or **INSERT** which is more convenient to do in a builder. #2 People need to quickly implement some standard feature or fix that may require a complex UI. Using the coordinator class you can replace an imported model with a builder call editor that can be customized to your liking. The SpreadSheet import builder is a good example of that. After picking a spreadsheet you're given sheet names and other information to work with. #3 A model based builder is becoming too complex to maintain. This is a rarity but a model based builder relies on profiling of various inputs and may be cumbersome to maintain if it grows too complex. #4 Only out of preference I tend to write java-based builders more than model based builders. I've been doing it that way for years and it just seems easier to me. Your mileage may vary. #5 I need to institute new functionality as a standard.. that others may use across projects (or on a large project) such as the IBM Email builder. #6 I need to write something that may be included in a model more than once. It can be tricky to write an imported model module that can be imported multiple times. Using a java-based builder you can use custom names and ID's for your artifacts. ** is this true for model based?** #7 Extending an existing builder. This is a fringe case, but there are certain times where you need to tack a bit of extra functionality on to a WEF builder. You can write your own builder which extends the original (even uses the same coordinator and cloned builder definition file), but utilizes a custom regen class. A similar technique was used at IBM for creating some of the atomic dojo builders (such as checkbox). The existing builders are time tested, so extending is a smart move.