Author Topic: OO Design Principles  (Read 2853 times)

Offline quadz

  • Loquaciously Multiloquent Member
  • ****
  • Posts: 5352
    • View Profile
  • Rated:
OO Design Principles
« on: November 03, 2008, 01:17:53 PM »
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus
"He knew all the tricks, dramatic irony, metaphor, bathos, puns, parody, litotes and... satire. He was vicious."

Offline Whirlingdervish

  • Super ShortBus Extravaganza
  • Illimitable Sesquipedalian Member
  • *
  • Posts: 6384
    • View Profile
    • The Dervish Depository
  • Rated:
Re: OO Design Principles
« Reply #1 on: November 03, 2008, 02:27:23 PM »
Pretty good info there.

A lot of it I picked up in C++ courses, but some of the principles weren't exactly worded as nicely as they are here.

Very simple and to the point, just like classes should be!  :beer:
« Last Edit: November 03, 2008, 02:52:02 PM by Whirlingdervish(Q2C) »
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus

kren.Z

  • Guest
Re: OO Design Principles
« Reply #2 on: November 04, 2008, 08:47:37 AM »
C++ is such a complex language. It's not really a comfortable language for mere mortals. The methods in the standard library are cryptic, the seperation of namespaces and class implementations are a pain in the ass, the same keywords have different meanings in different situations (I throw around const like a fucking ragdoll), and you have to garabage collect like it's your fucking day job.



Thanks for the link quadz. The beauty of OOP is applying the methodology to different languages.




....Actionscript  :P
« Last Edit: January 28, 2014, 01:51:14 PM by krenZ »
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus

Offline quadz

  • Loquaciously Multiloquent Member
  • ****
  • Posts: 5352
    • View Profile
  • Rated:
Re: OO Design Principles
« Reply #3 on: November 04, 2008, 10:50:52 AM »
Thanks for the link quadz. The beauty of OOP is applying the methodology to different languages.

Perhaps interestingly, while some of the principles on that list are arguably universal (DRY, for instance), others would seem to make more sense in a language like C++, than a highly dynamic language like Ruby.

For instance, ruby's classes are open.  And it's a feature of the language.  A feature that does require discipline to use without shooting yourself in the foot, to be sure.  And a feature that I use sparingly...  But also very handy on occasion.

Here's an example of ruby's open classes... From the interactive ruby prompt, I'll add an 'md5' method to the core String class, on-the-fly:

>> require 'digest/md5'
=> true
>> class String
>>   def md5
>>     Digest::MD5.hexdigest(self)
>>   end
>> end
=> nil
>> "fubar".md5
=> "5185e8b8fd8a71fc80545e144f91faf2"

All instances of String now respond to the method md5. :)

Here's a recent post from the ruby-talk mailing list about the application of some of the OO design principles on the above list, to ruby:

Quote from: cohen.jeff@ruby-talk
> Re: Ruby's take on S.O.L.I.D
> >> Any thoughts on how duck typing impacts the usefulness or necessity of
> >> these design principles? For instance, I don't really hear much
> >> regarding Liskov's Substitution Principle around Ruby programmers and am
> >> interested in opinions as to why.

I was a SOLID developer in my C# days, but I don't feel it applies as
well to dynamic languages like Ruby.

The S, I still agree with: single responsibility per class.

The O is something I'm on the fence about.  Ruby allows you to open
classes and modify them, and I've seen how valuable this is when you
know what you're doing.

The LID (substitution, inteface granularity, dependency injection) are
just non-issues for me with Ruby.  I enjoy duck-typing so much more
than worrying about interface granularities, and I don't need to use
dependency injection anymore (which I really only used to make things
more testable, which I can do with Mocha nowadays anyway).

I'd be interested in other viewpoints on this, but I think SOLID is
great advice only for statically-typed languages and isn't quite as
important with a language like Ruby.

For me, the SOLID equivalent would go like this:

Single Responsibility per Class
Drive your development with unit tests
Have fun

...but "SDH" isn't as easily pronounced as SOLID. :-)


Regards,

:bigshades:
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus
"He knew all the tricks, dramatic irony, metaphor, bathos, puns, parody, litotes and... satire. He was vicious."

Offline reaper

  • Opulent Member
  • *
  • Posts: 2872
  • Nice night for a walk, eh? - Nice night for a walk
    • View Profile
  • Rated:
Re: OO Design Principles
« Reply #4 on: November 21, 2008, 07:22:20 AM »
This guy has some funny comments in my favorite program.

I wish I could understand it, hopefully one day I will figure it out : ).  There is some object oriented  code, pointers and using of malloc, it's not to long and written in C.  But I stopped learning C after I got pointers down, I don't really understand structures and objects ( although I've used some OOP in perl, I just didn't really know what I was doing )

  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus
VaeVictus "reaper is a lying sack of shit and ragequit then had, probably slugs, come alias and beat me, wasnt even the same person playing OBVIOUSLY, accuracies basicly doubled, and strategy

 

El Box de Shoutamente

Last 10 Shouts:

 

Costigan_Q2

October 17, 2024, 06:31:53 PM
Not activated your account yet?

Activate it now! join in the fun!

Tom Servo

October 11, 2024, 03:35:36 PM
HAHAHAHAHAHA
 

|iR|Focalor

October 10, 2024, 12:19:41 PM
I don't worship the devil. Jesus is Lord, friend. He died for your sins. He will forgive you if you just ask.
 

rikwad

October 09, 2024, 07:57:21 PM
Sorry, I couldn't resist my inner asshole.
 

Costigan_Q2

October 09, 2024, 01:35:05 PM
Et tu rikwad?

Please don't feed the degenerate lies of a sexually-perverted devil-worshipping barking dog like Focalor.
 

RyU

October 09, 2024, 07:21:23 AM
lol
Been here since 2006


But I don’t mean you personally

By you I meant WE all suck at Q2
I guess I was just trying to be funny …

 
 

Costigan_Q2

October 08, 2024, 06:16:31 PM
Who the fuck are you?

Stop feeding degenerate lies, there are too many liberals and commies in this filthy rotting husk of a gaming community as it is.
 

RyU

October 08, 2024, 06:18:00 AM
whether you want to be a man a woman, a women that wants to be a man, a man that wants to be a woman,
a broom,
a mop,
Or even a horse,
Just know you still suck at Q2 ..  ;)
 

RyU

October 08, 2024, 02:38:09 AM
Some funny shit  :D

Show 50 latest
Welcome, Guest. Please login or register.
October 23, 2024, 12:23:13 AM

Login with username, password and session length