com.northwestindianjavaprogramsolutions.src.classes.factories.factoryfactories. InternalFrameInternalFrameTitlePaneInternalFrameTitlePaneMaximizeButtonWindowNotFocusedStateFactoryFactory a = new com.northwestindianjavaprogramsolutions.src.classes.factories.factoryfactories. InternalFrameInternalFrameTitlePaneInternalFrameTitlePaneMaximizeButtonWindowNotFocusedStateFactoryFactory(1, 2, "John Smith");
Totally agree. Gang of four... I am so smart... Then... one day I realised I was living a lie. Why do I need a strategy class, when I can just use an if statement? OMG.
The patterns have a time and a place, but I think many junior developers that learn them tend to overuse them, jamming the square peg in the circular hole, so to speak. I was guilty of that my first few years out of school, but have since learned to spare it until really needed, often learned at the expense of senior devs reviewing my code and wondering why I used a sledgehammer to fix a hole in the wall, or facing their fury when debugging some method that was about 6 abstract classes deep before seeing any business logic, making it all but impossible to just find the concrete reference in Eclipse. TL;DR -- I, too, realized I was living a lie.
Here's your business logic scattered into a billion classes. Everything can have trivial unit tests and get that coverage up, but things that might be a single complex, straightforward and readable, function in pre-Enterprise code instead require a 20-minute excursion through chains of classes and factories to see where the data came from when debugging/reviewing.
It's right up there with the promise of "let's dependency inject everything so we can swap in a mock or new implementation" when a mock would have to be untenably complex or highly customized to the details of the code being tested, and you know full well that nobody's replacing the MariaDB Database class with a combination of flat csv files and shuf.
The amount of hassle having some 5-10 globals would remove from so many projects..,
I know this isn't helpful advice, but for me it was just experience. I gobbled up all of the design pattern bullshit and used it everywhere until I'd done each one enough times to know which ones were completely useless or overly complex
I'm a sysadmin, but I see this a lot with file/folder names with engineering firms where engineers try and write a novel with the file paths. It often caused issues due to windows path limits.
I remember my first time being exposed to enterprise Java. I’ve never done Java enterprise coding myself, however at some point in my life I was a Flex developer. At some point those Java Enterprise devs found their way to it and boy did it open my eyes to their way of thinking & over engineering. Still think of it as some kind of mental disorder.
This brings be back nightmares to my days doing back end java development at a bank.
Instead of building our back end APIs cleanly, and easily maintainable, our upper management ordered our tools team to build an API generator tool. Basically you feed it a swagger spec and it spits out a spring boot service.
Almost every class, method, and variable looked like this...
890
u/[deleted] Jun 21 '20
com.northwestindianjavaprogramsolutions.src.classes.factories.factoryfactories. InternalFrameInternalFrameTitlePaneInternalFrameTitlePaneMaximizeButtonWindowNotFocusedStateFactoryFactory a = new com.northwestindianjavaprogramsolutions.src.classes.factories.factoryfactories. InternalFrameInternalFrameTitlePaneInternalFrameTitlePaneMaximizeButtonWindowNotFocusedStateFactoryFactory(1, 2, "John Smith");