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 C# or Java, 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.
C# have support for partial classes which is a class whose definition may be split into multiple pieces, within a single source-code file or across multiple files.
References
- ^ Fowler, Martin. "Generation Gap". martinfowler.com/. Retrieved 9 August 2014.
- ^ Vlissides, John (1998-06-22). Pattern Hatching: Design Patterns Applied. Addison-Wesley Professional. pp. 85–101. ISBN 978-0201432930.
Content Disclaimer
Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.
- The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
- There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
- It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
- Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
- Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.