
Episode 32 · Season 16
Rinse And Repeat - A template pattern
About this episode
One of the most powerful and useful patterns I have come across is one we will call rinse and repeat. It may also be seen as copy and paste or templates. However, the result is a way to rapidly generate a lot of similar solutions within an architecture or system.
The Rinse And Repeat Pattern Defined
The essential piece of the rinse and repeat pattern is a similarity in approaching a series of problems. This pattern becomes apparent when we solve a problem and then move on to another very close in its structure. For example, the classic almost anti-pattern of a class full of getters and setters can use this pattern. You build a list of attributes, build out the getters and setters, then rinse and repeat across the other container objects.
That is an elementary example of this pattern. We re-use the similarities from solution to solution as a starting point, then customize. The best part of this pattern is using a senior developer to solve the problem and then pass on the rinse and repeat portion to junior developers. Thus, we get a high-quality solution quickly and cheaply.
Applying The Pattern
The way to use this pattern is to isolate the areas that are the same from iteration to iteration. Then set up a pattern for implementing the differences. This may be a very rudimentary bit of work or could be something more complex like data mapping requiring business analysis. The goal is to make the work easy to estimate and repeatable. That allows us to tightly define the rinse and repeat actions while also understanding the effort typically involved. We then can do the work or farm it out with our detailed requirements and deliverables easily shared.
Challenges
Similar but not equal can be a trap. It is not uncommon for a rinse and repeat process to stumble across an outlier of some sort. That outlier can cause a substantial change to the approach or solution and break the ability for someone to quickly produce another iteration of the solution. The good news is that we still are not likely to do more work than would normally be required. We just need to adjust our estimates for an unforeseen chuck of extra work.More from Develpreneur: Become a Better Developer and Entrepreneur
A handful of people love your MVP. Their suggestions keep coming, and AI helps you turn those requests into working features quickly. The product is growing. Whether it is growing in the right directi…
Your team can generate an interface faster than ever. Meanwhile, customers are still staring at confusing error messages, waiting for pages to load, and trying to figure out what happens after they cl…
After a year of deadlines, long hours, and projects that seemed determined to last forever, Thanksgiving offers a chance to pause and enjoy what all that effort has made possible. In this Thanksgiving…
The holiday is almost here, but your brain is still at work. There is something to finish, something to check, and probably something you could squeeze in before everyone arrives. Closing the laptop s…
Building a successful business requires more than developing a great product. As companies grow, they face new challenges involving customer expectations, operational efficiency, financial decisions,…