tags:

views:

359

answers:

8

Being a core developer for couple of years, coding applications seeing the class diagrams, sequence diagrams, I decided to improve my self, taking the next step of designing. As I'm an OO developer, I'm interested in improving my design skills.

For Example, I had a hard time designing a currency converter.

My questions to the SO:

  • Is it by experience the design skills can be acquired?
  • Will learning books/blog/material over internet etc help?
  • Is it that one needs the domain knowledge of the application being developed?
  • Knowing Design patterns, principles?
  • Studying 'Code Complete' book ?
  • Need to have Problem-solving skills?

In short, given a problem, I just want to solve it in Object-oriented way??

A: 

To number your points - I think 2 - 6 are great and I think anyone writing code should read code complete, even if its not OO. But unfortunately it seems that point 1 is the most important!!!

I think that's a problem in our profession. We learn on the job as opposed to studying great code. So essentially everybody is re-inventing the wheel in terms of learning.

David Relihan
+2  A: 

I think you're going about this somewhat wrong, because some problems simply have no need of an object-orientated solution. The solution should match the problem, not the other way around.

However, there's no silver bullet to being a better object-orientated designer. The best way, in my opinion, would be to write a complex program, then maintain it solidly for a few years.

DeadMG
This is basically wrong: problems do not have "needs." Solutions are created using concepts, tools, and ideas. You have to want to OO, then you will find HOW it applies to the problem at hand (very badly, for a very small group of problems). Don't worry, though, you're in good company here on SO, where most people think that the nail is just begging for the hammer.
Yar
How else would you put a nail in?
DeadMG
Heel of a woman's shoe, most of the time. Or a nail gun.
Yar
Nail guns are in a somewhat different league to a hammer, and I don't think that a woman's shoe will cut it.
DeadMG
+1  A: 
  • Is it by experience the design skills can be acquired?

Experience and innate ability - some people just cannot do it.

  • Will learning books/blog/material over internet etc help?

Of course. But they won't turn you into an OO god.

  • Is it that one needs the domain knowledge of the application being developed?

Either you need to have it, or you need access to someone who does.

  • Knowing Design patterns, principles?

Knowing what design patterns are would be a good start - they are just common ways of doing things - nothing magic.

  • Studying 'Code Complete' book ?

I flicked through it in bookshop once.

  • Need to have Problem-solving skills?

Obviously yes, I would have thought.

anon
"inate [sic] ability" - so do you think it's like a genetic thing? The object-oriented gene?
Yar
@yar I don't know. I do know that some folks can and some (apparently equally bright) folks can't.
anon
Sounds reasonable. I'd chalk it up to passion (interest) more than anything, but your observation is correct.
Yar
Different people think in different ways.
DeadMG
+3  A: 

It is pretty obvious that if you want to learn something, you have to practice. If you want to learn how to be a better programmer, practice programming will help. And if you want to learn how to be a better OO programmer, practicing OOP will obviously help you most. Problem solving skills and knowledge of the domain are things every good programmer needs to have, not only for OOP. And there are a lot of good books out there, they will help you probably, if you are not the "to-less-focused-to-get-something-out-of-a-book" type of person.

Here is a list of programming books. From this list, "Design Patterns" and "Refactoring" seem to be very focused on OOP (I did not read "Head first design patterns", perhaps it is, too). And the book I learned most from (OOP, functional and other concepts), I think, is "Structure and interpretation of computer programs".

Doc Brown
+3  A: 

You have to do bad OO design before you can do good OO design.

A fantastic project would be take your currency converter and slowly move the code to use OO concepts. OO is a creative process: there are no wrong answers, but worse and better do exist. Basically, when your code retains functionality and gets shorter/easier-to-read, it's better. When it gains flexibility without adding more code, that's better too. But it's a creative process. Use a version control system like GIT to be able to "undo" easily, try stuff out, and MAKE MISTAKES. OO design is a process.

  • Is it by experience the design skills can be acquired?

Yes.

  • Will learning books/blog/material over internet etc help?

Yes.

  • Is it that one needs the domain knowledge of the application being developed?

Yes, but I think that knowing the domain too well can screw up good design. When working with Airline programmers, I noticed that the known, unquestioned abstractions ("ticket," "reservation") inhibited good OO design. Your OO model is not the real world model. It's a model for your program.

  • Knowing Design patterns, principles?

Yes, more is better, always.

  • Studying 'Code Complete' book ?

Lots of people say it's a great book. But, have you read Italo Calvino? Or Jorge Luis Borges? All kinds of books may help.

  • Need to have Problem-solving skills?

No. You get problem-solving skills by applying OO (or any other paradigm).

Yar
A: 

Additionally you can use the unit testing, as tool to improve the class design.

Avram
+1  A: 

I suggest you to learn Smalltalk. YES..I know it's a bit outdated but I think this is the only environment to experiment, appreciate and 'have fun' with Object Orientation.

In Smalltalk everything from the IDE is an object. You can think about objects without wasting time with details such as header/source files, compilation and so on.

Download a copy of Squeak Smalltalk (http://www.squeak.org/) and start practicing

pierocampanelli
+1  A: 

The biggest challenge in object-oriented design is not learning the implementation techniques, which come naturally with time and experience. The biggest challenge is understanding the problem domain sufficiently well that you can clearly abstract it with an object model. This is one of the points you hit upon in your question and I think it's certainly one of the most critical. If the problem is not well understood, then you run the risk of implementing a solution for the wrong problem. Further, it's easy to get caught up in the beauty of abstraction and architecture for its own sake, losing sight of the original task.

Dan Bryant