Skip to main content

Abstraction to a Point

Architecting and implementing software is a constant balancing act.  First the design has to work in the end but the underlying implementation can vary greatly, event during development.

Re-use existing classes that almost fit, or create a new or derived hierarchy for just what is needed.  Abstract out the needs in base and helper / utility classes, but not too complex to not allow modification for the ever changing requirements.  Is the abstraction clear to others that will be maintaing the code, months or years later?  Should the abstraction only existing for the main feature / operational aspects of the application or should they extend to the smaller aspects of the operations as well.

It's a constant battle of decisions during implementation.

The abstraction point is not isolated to development as the cost associated with these decisions can increase the code and timeline of the implementation and even place a project at risk.

During sprints for adding new features there is a temptation to refactor classes to make better use of abstraction, re-use of code and testing,  But this comes with a cost.  Too much refactoring can lead to instability of code (yeah I know the tests should catch errors, theory -vs- practice), lengthening deadlines and slowing of finishing the project as the more features are completed.  There is a balancing act to the refactor / abstraction dance.

Over the years, I've found my balance point of when to abstract and when not to.  My goal is to have a fare amount of abstraction but not to where the different logic hits the metal (like UI behavior) to occur.  Basically it's not to do abstraction when it feels forced or where complexity starts to build because of the abstraction.  The larger the abstraction granularity (base classes, MVC, command patter, etc) the lower the complexity.  The finer the abstraction the risk of increasing the complexity and the risk of harder to maintain, refactor, etc.  You can sometimes see this when there are abstractions upon abstractions, that's a red flag of complexity.

It's a tough balancing act to follow.  

Comments

Popular posts from this blog

My Current Desktop and Happy Vining.

It's been a big switch when I quit my old procession (Software Engineer) and ventured into the unknown.  So this is my current desktop.   First it's a REAL desktop and not a computer screen. Second, I've had to learn a whole new set of tools.  You would think a pencil is just a pencil and a paint brush is just a paint brush, but noooooo, they are tools into you mind and that's what needs re-tooling. The tactual nature of these tools and operation as much more rewarding (and frustrating too) than typing code in an IDE.   That had it's incentive but that well went dry and life changes,  so I changed. The pleasure of creating colors (no RGB involved) ad hoc wise is interesting.  Getting the technique to merge them on paper is very tough.  You do not know what you're going to get, so you just have to go with it. I'm glad that I can do a lot of other things instead of Software, but I hope that others in my past procession work on other pa...

3rd Try is a Charm

I've been trying to draw / paint these barns for a couple of years but never felt or got them right.  This time I think they turned out right. So What went wrong before and what's right now with this drawing?  This time, the light was right.  It's coming from the upper right and the shadows just looked right.  The other thing is the corn field on the left had to "be in season", otherwise it's just a plowed field.  I had taken other photos from different angles but they never felt right.  This angle has the road, power lines, corn field, etc. all leading to the right.  The shadows on the lower right helps fill in that corner (don't forget about the corners!).  The last part is trying to draw (ink paint maybe) the trees in the background.  Not so easy when they are kind of a blob is green shades. So yeah, it's composition that is king.  Many times I just don't see it until the drawing / painting is finished and when it's right it feels goo...

Thought Patterns

I know how I work.  How a think about, visualize a problem and go about mentally design a solution and implement it in code.  My thought pattern works pretty well for me on most occasions, but not always. There are times when I have a force myself to change my thought pattern because of the problem I'm solving requires a different mindset.  Anyway, this posting is about how I work most of the time.  Here is goes. I quickly break down a feature into operations that are required to exists and tackle that code first.  My thinking is that, if I can solve the primary issues first, then secondary features will fall into "known knowns" and I can address those at anytime (and sometimes at my leisure) and this allows me to meet my internal timeline. If I addressed features and operations that are not primary first, then I feel I risk my (and the projects) timeline without addressing issues that allow the feature to operate.  You may have seen this occur where...