3 ms·
Yeah, I've seen people go down this path. In the next step they realize they need an if-statement to determine whether to instantiate a PDFPrinter or a MSWordPr
by rejschaap 14y ago
Yeah, I've seen people go down this path. In the next step they realize they need an if-statement to determine whether to instantiate a PDFPrinter or a MSWordPrinter. Which they conveniently hide inside an AbstractPrinterFactory or a ComplexPrinterBuilder. This is probably how the whole Enterprise Java thing got started.
- arethuza 14y agoMy own pet theory is that 95% of the enterprise code carefully architected to be extensible is never extended.
- gutnor 14y agoSimilarly, when there are no extension points, extension get hacked in (= "if" everywhere !) Here is my experience with architected extension points: 1. Generally the first extension point used set the trend, other developers will follow the "pattern" blindly. Hacking to make it fit rather than use another more appropriate extension. That is both bad and common (everyone has had to work with too little time) 2. There is often a sharp refocus close before or after release 1.0. A lot of the extensions disappear at that stage (demo, experimental feature, cross-platform/framework support, performance targets are set, security infrastructure is decided, server setup, integration test env. available instead of simulated, ...). Structural change (like removing extension point) become very difficult to justify after release 1.0. 3. Technical debt is very often called "selling feature" at management level. But yeah, real world code sucks.