Click here to Skip to main content
15,881,424 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: OO Software design epiphany - it might not matter Pin
NelsonGoncalves13-Jan-21 21:59
NelsonGoncalves13-Jan-21 21:59 
GeneralRe: OO Software design epiphany - it might not matter Pin
_WinBase_13-Jan-21 23:00
_WinBase_13-Jan-21 23:00 
GeneralRe: OO Software design epiphany - it might not matter Pin
Ed Korsberg14-Jan-21 1:29
Ed Korsberg14-Jan-21 1:29 
GeneralRe: OO Software design epiphany - it might not matter Pin
PhilipOakley14-Jan-21 2:03
professionalPhilipOakley14-Jan-21 2:03 
GeneralRe: OO Software design epiphany - it might not matter Pin
Ed Korsberg14-Jan-21 3:35
Ed Korsberg14-Jan-21 3:35 
GeneralRe: OO Software design epiphany - it might not matter Pin
PhilipOakley14-Jan-21 5:08
professionalPhilipOakley14-Jan-21 5:08 
GeneralRe: OO Software design epiphany - it might not matter Pin
DumpsterJuice14-Jan-21 1:43
DumpsterJuice14-Jan-21 1:43 
GeneralRe: OO Software design epiphany - it might not matter Pin
Lurk14-Jan-21 2:16
Lurk14-Jan-21 2:16 
The real problem with OO Programming and possibly Design is that everyone knows the parts, but most don't put them together well. OO has worked well for years and it is visible at the low level.

Consider the storage device. It can be a floppy (remember those?), a hard drive, an SSD, a write once, CD/DVD, an online storage, an so many more. But the block storage protocol is applied to all. the Driver converts the hardware to an object that responds to the same inputs no matter what is hidden behind the interface. The device is the object. The functionality is abstracted and hidden. The behavior is locked behind the wall. And the new types of devices are added invisibly to the higher levels of code by following the interface rules. Enhancements to the rules are added all the time by extending the interface for things that were not previously considered.

The trick is in creating the specific, but only working with the generic. The failure is in creating specific necessary behavior at the derived level that cannot be used at the generic level.

Hierarchy of Animal -> Quadruped -> Horse.
Horse whinnies and gallops. But to implement them as Horse features means that they must be addressed as features of a horse.
Instead, Animal Speaks(Friendly | Loudly | Fearfully ), Moves( Slowly | Quickly )
Now, we can say Animal->Speak(Friendly), Animal->Moves( Quickly).
We can add Dog and a Cat and implement the interface described. Then we create the item and put it in Animal and use it without changing the code at all.

The biggest trick of all, is to construct the Animal (or derived type) with as much of the descriptive information as possible. then use it with as little information as possible.

Compare to the original Storage idea. the File Create and Open takes all kinds of descriptive information, but the actions on it take only the necessary variations. File->Read( howMuch, toWhere). File->Seek(toPosition, fromWhere).

It isn't really the tenants of OO that are in question, it is the organization. Put them together and use them well and they provide for an easier path to expansion, adaptation and improvements.

Print is a great example of Polymorphism.
Print (integer)
Print (string)
Print (float)
Print (format, arg1, arg2, arg3, ...)
Print (Animal)

OO is more than a Hammer. It is a whole Toolbox than can be used to build better tools and expandable structures.
GeneralRe: OO Software design epiphany - it might not matter Pin
Matt Bond14-Jan-21 2:51
Matt Bond14-Jan-21 2:51 
GeneralRe: OO Software design epiphany - it might not matter Pin
davercadman14-Jan-21 3:00
davercadman14-Jan-21 3:00 
GeneralRe: OO Software design epiphany - it might not matter Pin
obermd14-Jan-21 3:48
obermd14-Jan-21 3:48 
GeneralRe: OO Software design epiphany - it might not matter Pin
Adam O'Neil (Travelers Rest, SC)14-Jan-21 3:49
Adam O'Neil (Travelers Rest, SC)14-Jan-21 3:49 
GeneralRe: OO Software design epiphany - it might not matter Pin
davila a.k.a. Member 1490950114-Jan-21 3:58
davila a.k.a. Member 1490950114-Jan-21 3:58 
GeneralRe: OO Software design epiphany - it might not matter Pin
Rusty Bullet14-Jan-21 5:23
Rusty Bullet14-Jan-21 5:23 
GeneralRe: OO Software design epiphany - it might not matter Pin
Chris Boss14-Jan-21 6:08
professionalChris Boss14-Jan-21 6:08 
GeneralRe: OO Software design epiphany - it might not matter Pin
SeattleC++14-Jan-21 6:09
SeattleC++14-Jan-21 6:09 
GeneralRe: OO Software design epiphany - it might not matter Pin
Dale Barnard14-Jan-21 6:18
Dale Barnard14-Jan-21 6:18 
GeneralRe: OO Software design epiphany - it might not matter Pin
sasadler14-Jan-21 7:00
sasadler14-Jan-21 7:00 
GeneralRe: OO Software design epiphany - it might not matter Pin
Paul Gehrman14-Jan-21 17:23
Paul Gehrman14-Jan-21 17:23 
GeneralRe: OO Software design epiphany - it might not matter Pin
Member 289602014-Jan-21 17:24
Member 289602014-Jan-21 17:24 
GeneralRe: OO Software design epiphany - it might not matter Pin
KateAshman15-Jan-21 5:26
KateAshman15-Jan-21 5:26 
GeneralRe: OO Software design epiphany - it might not matter Pin
BotReject18-Jan-21 4:30
BotReject18-Jan-21 4:30 
GeneralRe: OO Software design epiphany - it might not matter Pin
charlieg22-Jan-21 11:56
charlieg22-Jan-21 11:56 
GeneralRe: OO Software design epiphany - it might not matter Pin
Martin ISDN1-Feb-21 8:18
Martin ISDN1-Feb-21 8:18 
GeneralHorror videos on youtube! Pin
CodeWraith13-Jan-21 4:05
CodeWraith13-Jan-21 4:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.