Synopsis: Magic Beans
Let’s learn how we can save developers’ time using a simplified model.
We'll cover the following
Let’s imagine another scenario. “Why is it taking so long to add one little feature?” asks your manager one day. Your manager had assigned your team to enhance the bug-tracking application to show a count of how many comments a bug had received. You’ve been working on this task for four weeks.
Your group of software developers in the meeting room look reluctant to answer the question. As project lead, you answer, “We’ve had a couple of false starts,” you explain. “It seemed simple at first until we realized there were some other screens in the application where we needed to show the comment count.”
“And designing the screens took four weeks?” your manager asks.
“Well, no, that’s just a little bit of HTML, and that’s pretty easy since we use the framework that separates code from presentation,” you go on. “But each time we added this element to a screen, we had to duplicate code to fetch data in the screen’s back-end code. And that meant each back-end class needed a new suite of tests.”
“Don’t we use a testing framework?” your manager asks. “How long does it take to code a few more tests?”
“Writing tests isn’t as simple as writing the code,” another engineer says hesitantly. “We also created scripts for test data. Then we needed to reload data on the test database for each test. We needed to test the front end too with all the permutations of the new feature combined with the old scenarios.”
Your manager’s eyes are now starting to glaze over, but your co-worker continues, “We now have 600 tests for the front end, and each one runs an instance of a browser emulator. It just takes time to run through all those tests. There’s nothing we can do about that.”
Your manager takes a deep breath and says, “OK…I didn’t follow all that. I just want to know why it is so complicated to add one simple feature. Wasn’t your object-oriented framework supposed to make it quicker and easier to add features?”
Good question.
Objective: Simplify models in MVC
Web application frameworks make it faster and easier to add features and code to an application. The most significant contributor to the cost of a software project is development time. So, the more we can reduce developer time, the less expensive it is to produce software. Robert L. Glass perceptively said,
One way we assist the intellectual part of software development is to adopt the terminology and conventions of design patterns. When we say “Singleton” or “Facade” or “Factory”, the other developers on our team know what we mean and that saves a lot of time.
Much of the code in any application is repetitive — practically boilerplate. Frameworks help improve coding productivity by giving us reusable components and code generation tools. We can produce working software applications while writing little original code.
Design patterns and software frameworks come together when we use the Model View Controller (MVC) architecture.
Get hands-on with 1400+ tech skills courses.