Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Secret to achieve good OO Design [closed]

Tags:

I am a c++ programmer, and I am looking forward to learning and mastering OO design.I have done a lot of search and as we all know there is loads of material, books, tutorials etc on how to achieve a good OO design. Of course, I do understand a good design is something can only come up with loads of experience, individual talent, brilliance or in fact even by mere luck(exaggeration!).

But sure it all starts off with a solid beginning & building some strong basics.Can someone help me out by pointing out the right material on how to start off this quest of learning designing right from the stage of identifying objects, classes etc to the stage of using design patterns. Having said that I am a programmer but I have not had a experience in designing.Can you please help me take someone help me out in this transition from a programmer to a designer? Any tips,suggestions,advice will be helpful.

[Edit]Thanks for the links and answers, I need to get myself in to that :) As i mentioned before I am a C++ programmer and I do understand the OO basic concepts as such, like inheritance, abstraction, polymorphism, and having written code in C++ do understand a few of the design patterns as well.what i dont understand is the basic thought process with which one should approach a requirement. The nitty grittys of how to appraoch and decide on what classes should be made, and how to define or conclude on relationships they should have amongst themselves.Knowing the concepts(t some extent) but not knowing how to apply them is the problem i seem to have :( Any suggestions about that?

like image 353
Alok Save Avatar asked Sep 21 '10 07:09

Alok Save


People also ask

How can I be good at object-oriented programming?

Object-oriented programming aims to implement real-world entities like inheritance, abstraction, polymorphism, and encapsulation in programming. The main aim of OOP is to bind together the data and the functions that operate on them so that no other part of the code can access this data except that function.

How do you design a class in C++?

Create a ClassA class is defined in C++ using keyword class followed by the name of the class. The body of the class is defined inside the curly brackets and terminated by a semicolon at the end. class className { // some data // some functions };

How do you think object-oriented?

The basic idea of OOP is quite simple: you write classes that represent objects in the problem domain. For example, if you're writing a program for car rental billing, you will create objects to represent cars, customer accounts, invoices, things like that.


1 Answers

  1. (very) Simple, but not simplist design (simple enough design if you prefer) : K.I.S.S.
  2. Prefer flat hierarchies, avoid deep hierarchies.
  3. Separation of concerns is essential.
  4. Consider other "paradigms" than OO when it don't seem simple or elegant enough.
  5. More generally : D.R.Y. and Y.A.G.N.I help you achieve 1.
like image 162
Klaim Avatar answered Sep 19 '22 15:09

Klaim