8 Replies - 7253 Views - Last Post: 03 August 2012 - 03:36 PM

#1 blue hoots  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 1
  • Joined: 16-June 12

Designing before Coding

Posted 01 August 2012 - 02:20 PM

What is the best way to design with an OOP mindset? The books and tutorials that I have read always say "design your project first before coding", which makes perfect sense and I would love to do it. However, none of those books or tutorials explains how to design a project. They usually just show you the design they came up with but don't explain how they came up with the design. So what are the best practices and techniques that people use to design their code before coding?

Is This A Good Question/Topic? 2
  • +

Replies To: Designing before Coding

#2 modi123_1  Icon User is offline

  • Suitor #2
  • member icon



Reputation: 8396
  • View blog
  • Posts: 31,234
  • Joined: 12-June 08

Re: Designing before Coding

Posted 01 August 2012 - 02:24 PM

Look at various "SRS" or 'software requirement specification' examples.. class diagrams.. data diagrams.. etc.. Ideally you would want to map out the entire space of your project (how users interact.. how data is going from state to state to state... how it looks.. limitations on input.. etc) and then generate milestones and coverage for all those areas. Then you know when something's done as well as can figure out if parts logically can fit together.
Was This Post Helpful? 0
  • +
  • -

#3 jon.kiparsky  Icon User is offline

  • Pancakes!
  • member icon


Reputation: 7301
  • View blog
  • Posts: 12,158
  • Joined: 19-March 11

Re: Designing before Coding

Posted 01 August 2012 - 05:58 PM

You can also think about use cases, "user stories" and the like. What will someone do with this software. For example, if you're designing the software for an ATM, you might have stories like:
"Jane Can Deposit a Check" and "Jack can withdraw money" and "Hubert can transfer money from one account to another". The stories you tell should be simple - they should fit on an index card - and spare the details. You use them more to specify features - they're all about what various users of the software can accomplish with your software.
Once you have these, you can think about what's involved in implementing them, write up some workflows, figure out what sorts of risks each one entails, and so forth.

When you've got a good idea of what sorts of entities are required, you can start thinking about structures, and drawing boxes and lines. Thinking ahead about how the code will flow from point to point will help you pre-make your mistakes, and avoid writing yourself into a corner. However, you can expect to make design mistakes at first, because that's what happens when you're learning a new trick.
Was This Post Helpful? 2
  • +
  • -

#4 Lemur  Icon User is offline

  • Pragmatism over Dogma
  • member icon



Reputation: 1335
  • View blog
  • Posts: 3,400
  • Joined: 28-November 09

Re: Designing before Coding

Posted 01 August 2012 - 06:19 PM

Here's my design process for large projects:

Preliminary Study - Identify the issue in its entirety, What is the issue?

Analysis - What is currently being done to solve the issue? Why is it failing? This involves the current data models that are in place and current procedures and programs.

Preliminary Design - Brainstorm all possible solutions to the issue, select only the most practical and effective to go to the next stage. This involves data models for databases.

Detailed Design - Elaborate and detail the selected ideas from the previous stage, including the designs for proposed solutions (say, programs)

Development - Write the thing

Deployment - Ship it out

Training - Get everyone up to speed

Maintaining - Make sure it stays working, or pawn it off on someone else.

------

The biggest point is to make sure you know your data inside and out. If the data is bad and poorly formatted then everything will fall apart. Data data data data. Everything relies on the data.

Good data means an easy program to write and maintain, bad data means a living hell.
Was This Post Helpful? 2
  • +
  • -

#5 Skydiver  Icon User is online

  • Code herder
  • member icon

Reputation: 3183
  • View blog
  • Posts: 9,647
  • Joined: 05-May 12

Re: Designing before Coding

Posted 02 August 2012 - 01:40 AM

If you pick up a book by Grady Booch, he will show you in mind numbing detail how to design a system. Too formulaic for me, though. Large companies and managers like it, though because it produces lots of tangible outputs that they can measure.

I tend to lean more towards the Agile approaches to things which takes a more organic approach to design and development. The same steps described by Lemur tend to happen, but at a much smaller scale with the goal of iterating quickly, and iterating often. It works great when working with clients as they see progress and they have a much closer hand in the development process and influencing of features. (People who produce packaged software avoid the agile approach because they can't iterate quickly and often. Unless they produce CD's boxes, and manuals just-in-time, they will have to destroy old stock that is sitting on the shelves.)
Was This Post Helpful? 0
  • +
  • -

#6 cfoley  Icon User is offline

  • Cabbage
  • member icon

Reputation: 1910
  • View blog
  • Posts: 3,954
  • Joined: 11-December 07

Re: Designing before Coding

Posted 03 August 2012 - 10:25 AM

I'm currently working my way through The Architecture of Open Source Applications:
http://www.aosabook.org/en/index.html

It won't give you a formula for designing systems but it will give you a whole bunch of ideas to draw from.
Was This Post Helpful? 3
  • +
  • -

#7 jon.kiparsky  Icon User is offline

  • Pancakes!
  • member icon


Reputation: 7301
  • View blog
  • Posts: 12,158
  • Joined: 19-March 11

Re: Designing before Coding

Posted 03 August 2012 - 10:35 AM

Quote

I'm currently working my way through The Architecture of Open Source Applications:
http://www.aosabook.org/en/index.html

That looks like an incredibly useful reference, I'm going to have to pick up a copy. (yes, an actual on-the-bookshelf copy!) Not sure how much it'll help the OP to learn planning and design, but as you say, it'll be a great sourcebook.
Was This Post Helpful? 0
  • +
  • -

#8 AnalyticLunatic  Icon User is offline

  • D.I.C Lover

Reputation: 218
  • View blog
  • Posts: 1,004
  • Joined: 25-June 12

Re: Designing before Coding

Posted 03 August 2012 - 11:08 AM

View PostLemur, on 01 August 2012 - 06:19 PM, said:

The biggest point is to make sure you know your data inside and out. If the data is bad and poorly formatted then everything will fall apart. Data data data data. Everything relies on the data.

Good data means an easy program to write and maintain, bad data means a living hell.


Could not agree more. This was a concept constantly hammered into the skulls of my fellow students and I during Tech College.
Was This Post Helpful? 0
  • +
  • -

#9 darek9576  Icon User is offline

  • D.I.C Lover

Reputation: 198
  • View blog
  • Posts: 1,672
  • Joined: 13-March 10

Re: Designing before Coding

Posted 03 August 2012 - 03:36 PM

Yeah, the book looks awesome. I will have to pick it up as well but not at the moment.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1