Generation gap (pattern)

Generation gap is a software design pattern documented by John Vlissides that treats automatically generated code differently than code that was written by a developer. Modifications should not be made to generated code, as they would be overwritten if the code generation process was ever re-run, such as during recompilation.[1] Vlissides proposed creating a subclass of the generated code which contains the desired modification.[2] This might be considered an example of the template method pattern.

Modern languages

Modern byte-code language like Java were in their early stages when Vlissides developed his ideas. In a language like Java or C#, this pattern may be followed by generating an interface, which is a completely abstract class. The developer would then hand-modify a concrete implementation of the generated interface.

gollark: It does look nice. I'm probably just oversensitive to these things.
gollark: Yep!
gollark: Also, I find it kind of ironic that a minimalist (well, design-wise) website ends up taking about 5 seconds to load fully, and according to my browser devtools pulls down 6MB of fonts, images, scripts and whatever else. Which is... unfortunately pretty much the standard with the internet now.
gollark: Wait, *final* book? I wonder how it's going to end up resolving everything.
gollark: Fun fact: if you put the URL between < and >, it won't display the embed.

References

  1. Fowler, Martin. "Generation Gap". martinfowler.com/. Retrieved 9 August 2014.
  2. Vlissides, John (1998-06-22). Pattern Hatching: Design Patterns Applied. Addison-Wesley Professional. pp. 85–101. ISBN 978-0201432930.


This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.