You made a big design mistake

I spent the last day or so creating a set of classes for parsing some events from the telephony system and then registering them in a database. Having created 5 out of a dozen classes, I decided that I would need to parse the event parameters into a hash table to find out what the event was and create an insert statement. (Base class and interface for event classes and events that store all event data + factories ...)

I had the vile thing that the whole design was a bit complicated for what he needed to do, since there was no manipulation of events at all.

I reworked it to three methods that take headers and header data and return an insert request ...

So, I think Ockham Razors hit again ...

What is your biggest complication of a simple probe? And when did you have that moment of “forehead strike”, when did you realize that you developed it in high hell?

+4
source share
7 answers

Creating abstract classes before I had several subclasses for them. This sounds trivial, but you end up making all kinds of assumptions about the behavior of “future” classes, which may or may not be written, and these assumptions usually turn out to be wrong.

+8
source

I used PHP once.

+7
source

More troubleshooting problems than excessive design, but when I was a kid, Dad and I spent several weeks building for me a rather complicated and complex model layout. We planned to make the "event" of the train. When everything was finally “just like that”, we connected the transformer, pushed the throttle forward and were embarrassed to watch the train go back.

We were going to grab the tools and start rewinding when mom suggested: “Why don't you just turn the train.”

Sheesh.


Edit: I expect, over the years, that my children will solve the same problem by clicking the sign bit.

+4
source

The biggest mistakes that I have ever made are usually not from existing existing implementations of technologies, but because the existing solution is not widely known, etc.). So yes, overriding a subset of HTTP when I could use HTTPClient when developing a RESTful service (back when I didn't know what REST was for).

+2
source

I had a week to implement a concept concept for an integration gateway from one system to another.

I started by programming CommandExecutionService, which execute several complex Commands in pararell via ThreadExecutionService.

Then I made some example commands, for example, wait 10 seconds or print a random number.

And today I realized: integration is as simple as parsing the result set and sending some messages to the queue, as well as getting some messages from the queue and creating an sql update from it. And it still deploys to WAS.

So now I am sitting here with 30 classes full of code to do something with 200 lines ...

Next time I will crack it in Perl.

+2
source

Creating a COM-based VBScript engine and thinking end-users actually use it.

+2
source

I did a series of scripts in windows to defragment my HD and turn it off, so at the end of every day I could just click the icon and it will do everything for me.

unfortunately, it was 3 a.m., and I confused the defrag and format commands.

Yes, it wasn’t very fun waking up on the “Operating system not found” on the screen.

+2
source

Source: https://habr.com/ru/post/1277646/


All Articles