|
|
Ian Shlasko wrote: I probably should submit an article with this analogy
It is a fantastic analogy. You got my 5!
|
|
|
|
|
Very good analogy, much better than mine, but did you really write that analogy on the fly or did you have it tucked away in a file somewhere? If you did it on the fly I'm doubly impressesed Anyway you got my vote. Cheers.
topcoderjax - Remember, Google is your friend.
|
|
|
|
|
On the fly
I was bored, trying to take my mind off a nasty design flaw in my application... Spend too much time on one bug, and you start to zoom in and lose the big picture.
|
|
|
|
|
To go back to a very bad example in school
if you have an animal class and dog cat and fish inherit from animal. It might be useful in some cases to treat them all as animals. In your example if you had several types of customers it might be useful to treat the all as GenericCustomer, or perhaps you might have a method that takes a GenericCustomer as a paramiter, so casting Nevermore60Customer to GenericCustomer and passing it might make sense.
I have to admit though I only skimmed your example, so I can't say for certain if it is needed there or not. Too often tutorial code shows you what can be done without giving you a good reason why.
If you want a good book on when and why to use inheritace I recommend a book called "Design patterns explained" second edition by Alan Shalloway,James Trott. I don't think it is .net specific but the concepts all apply.
topcoderjax - Remember, Google is your friend.
|
|
|
|
|
Well, what do you think? Looks like there are 3 possibilities:
1) it will not compile at all
2) customer will be instance of abstract class (hint hint) GenericCustomer, and you will lose data referrerName and highCostMinutesUsed
3) customer will be instance of Nevermore60Customer
"Throughout human history, we have been dependent on machines to survive. Fate, it seems, is not without a sense of irony. " - Morpheus
"Real men use mspaint for writing code and notepad for designing graphics." - Anna-Jayne Metcalfe
|
|
|
|
|
The code compiles actually, my question was different...
Jon
|
|
|
|
|
Yes I know it compiles. This leaves you 2 other possibilities, keep trying...
"Throughout human history, we have been dependent on machines to survive. Fate, it seems, is not without a sense of irony. " - Morpheus
"Real men use mspaint for writing code and notepad for designing graphics." - Anna-Jayne Metcalfe
|
|
|
|
|
"Real men use mspaint for writing code and notepad for designing graphics."
what does this imply?
|
|
|
|
|
Haha it sure is good sig. What it means? Hmm. That "real men" do things the hard way? Or that real men are like Chuck Norris?
"Throughout human history, we have been dependent on machines to survive. Fate, it seems, is not without a sense of irony. " - Morpheus
"Real men use mspaint for writing code and notepad for designing graphics." - Anna-Jayne Metcalfe
|
|
|
|
|
i dint understand! whts wrong with Chuck Norris?
|
|
|
|
|
Hey all,
You know when you connect a new piece of hardware to a XP computer you get a little bubble/balloon informing you that your "new hardware is installed and ready for use"? Can some one point me in the direction of manipulating that for my own C# app?
Freedom is the right to say that 2+2=5 if this is so everything else will follow.
|
|
|
|
|
|
JF2015. That is perfect. Even better than what I was looking for.
JF2015 <----Legend.
Thanks.
Freedom is the right to say that 2+2=5 if this is so everything else will follow.
|
|
|
|
|
MicealG wrote: Freedom is the right to say that 2+2=5 if this is so everything else will follow.
So who/what keeps you from shouting out loud that 2+2=5 in the UK? Go ahead. See what happens.
The more I see of men, the better I like my dog. Blaise Pascal.
|
|
|
|
|
Its a quote from one of my favourite books 1985.
P-p-p-p-pick up a book some time.
Freedom is the right to say that 2+2=5 if this is so everything else will follow.
|
|
|
|
|
Don't you think this book is called 1984 by George Orwell, or do you mean a different one?
|
|
|
|
|
1. The book's name IS 1984. I've read it.
2. How can you not remember the name of your favorite book?
3. The quote actually is:
"Freedom is the freedom to say that two plus two make four. If that is granted, all else follows."
You have completely misunderstood the whole thing. Take a look:
http://en.wikipedia.org/wiki/Two_plus_two_makes_five[^]
PS: What have you been smoking, man?
The more I see of men, the better I like my dog. Blaise Pascal.
|
|
|
|
|
1 - My Bad.
2 - I don't know.
3 - Did you actually look it up to get back at me? Man go out, get laid.
And in answer to your PS, WEED!
PS: Don't whack-off too much you might lose your sight, then you won't be able to use Wikipedia any more and I know that will suck for you, but don't worry cause even after you've gone blind you'll still be able to jack-it, unfortunately it does mean that you won't be able to prove people wrong who can't remember every line out of every book that they read.
PPS: If you have nothing better to do than ask stupid questions then stop wasting my time. Besides you could be whacking off.
* If you'd like to pick out any spelling and/or grammar errors that I might have made that would be great, although it would prove that you are a pedantic, anal retentive poignant fool (use Wikipedia if you don't understand any of the words).
Freedom is the right to say that 2+2=5 if this is so everything else will follow.
|
|
|
|
|
|
That's worth a 5 just for pricking the smug bubble.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
I have a program that uses an XML file to set up the programs configuration.
What I want to do is use the XML file to set up shortcut keys so that they run specific events on specific user controls. (e.g. bind Return to a user control and bind F7 to a different user control)
Just to note, but registering the keys as Hotkeys doesn't work, as I only want the shortcut keys to work while the program has focus. (And registering the keys as hotkeys is a bad thing. I want to bind Return to a control, but if I register it as a HotKey, then return does not work in other programs for as long as my one is open.)
- Dave
|
|
|
|
|
Hi,
Now, I need to rename the application after build process.
Now, the project name is set to MY.PROJECT.UI because it's major on the UI feature.
But, I need to change the application name to MyProject.exe
How can I do?
Do you have any suggestion?
|
|
|
|
|
Project properties allows you to specify the assembly name.
|
|
|
|
|
It's so kind of you.
|
|
|
|