|
Not sure what you're thinking here. In our instance we needed a generic baseclass to provide a typesafe implementation of common static methods.
So we have
public class MyType : BaseTypeController<MyType>
{
...
}
and then we do
MyType result MyType.GetType()
(I know all the purists have just thrown up at the thought of using a static method to return an object, but these are core "type" entities that specifically aren't being given the opportunity to have their implementations replaced via IoC or whatever. They are essentially type-safe rich enums (sorta) that get the collection of values they can take from the database. eg PublishingStatus is of type BaseTypeController so we can do things like PublishingStatus.FromName("Available") , or we can define some "must-have" values and then do PublishingStatus.Available , and then when we need a new publishing status value in the DB, we just add the row and the code all continues happily with no recompilation needed.
I'm running on too little sleep so I'm drawing a blank as to how you'd do that with extensions.
cheers,
Chris Maunder
The Code Project | Co-founder
Microsoft C++ MVP
|
|
|
|
|
I recall having done something like that in the last year, but the details escape me at the moment and a quick search of my library didn't turn anything up.
|
|
|
|
|
I found proof, but have no room to write it in this margin.
|
|
|
|
|
Aaa
aa
rr
r
r
r
g
g
.
.
.
|
|
|
|
|
|
I think it's beautiful, personally...
Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
In the face of ambiguity, refuse the temptation to guess.
|
|
|
|
|
Jack Tramiel[^] has died.
The man that gave us the PET, The VIC 20 and, of course, the C64.
The man knew how to sell computers.
His influence is still reverberating with us today.
---------------------------------
I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave
CCC Link[ ^]
English League Tables - Live
|
|
|
|
|
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
He also gave us the Atari ST. I wrote my first commercial program on and for the Atari ST back in 1989-90.
m.bergman
For Bruce Schneier, quanta only have one state : afraid.
To succeed in the world it is not enough to be stupid, you must also be well-mannered. -- Voltaire
Honesty is the best policy, but insanity is a better defense. -- Steve Landesberg
I am not a chatbot.
|
|
|
|
|
Father Commodore boots up no more
Steve
_________________
I C(++) therefore I am
|
|
|
|
|
Three year old sings the 'Elements Song'[^].
I didn't finish the subject line because I am torn between 'sweetie' type terms and slightly more pejorative ones. Wonder who's idea it was to learn it?
Perhaps it is that I am jealous. When I was three I could only manage the chorus of Flanders and Swan's rendition of Pee po belly bum drawers[^].
Henry Minute
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
I wouldn't let CG touch my Abacus!
When you're wrestling a gorilla, you don't stop when you're tired, you stop when the gorilla is.
Cogito ergo thumb - Sucking my thumb helps me to think.
|
|
|
|
|
Henry Minute wrote: Wonder who's idea it was to learn it?
Helicopter parents' [^]
"I have a theory that the truth is never told during the nine-to-five hours. "
— Hunter S. Thompson
|
|
|
|
|
Did you mean helicopter parent[^]?
Independent ACN Business OwnerMake toll free long distance calls from your smart phone with ACN Mobile World. When connected via wifi, calls will not use any of your minutes or data, nor will there be any roaming charges. Certain conditions apply. See my website for details.
Within you lies the power for good - Use it!
|
|
|
|
|
I found this one interesting:
This one anagrams 30 elements from the Periodic Table
of the Elements into 30 other elements (and all 60 elements
that appear in the anagram are distinct):
hydrogen + zirconium + tin + oxygen + rhenium + platinum +
tellurium + terbium + nobelium + chromium + iron + cobalt +
carbon + aluminum + ruthenium + silicon + ytterbium + hafnium +
sodium + selenium + cerium + manganese + osmium + uranium +
nickel + praseodymium + erbium + vanadium + thallium + plutonium =
nitrogen + zinc + rhodium + helium + argon + neptunium +
beryllium + bromine + lutetium + boron + calcium + thorium +
niobium + lanthanum + mercury + fluorine + bismuth + actinium +
silver + cesium + neodymium + magnesium + xenon + samarium +
scandium + europium + berkelium + palladium + antimony + thulium
But there's more: if we replace each element by its atomic number (position in the Periodic Table), there is still equality:
1 + 40 + 50 + 8 + 75 + 78 +
52 + 65 +102 + 24 + 26 + 27 +
6 + 13 + 44 + 14 + 70 + 72 +
11 + 34 + 58 + 25 + 76 + 92 +
28 + 59 + 68 + 23 + 81 + 94 = 1416
7 + 30 + 45 + 2 + 18 + 93 +
4 + 35 + 71 + 5 + 20 + 90 +
41 + 57 + 80 + 9 + 83 + 89 +
47 + 55 + 60 + 12 + 54 + 62 +
21 + 63 + 97 + 46 + 51 + 69 = 1416
|
|
|
|
|
Starting to get bored with the Visual Studio Mag. Any other good ones out there around .NET development?
|
|
|
|
|
Perhaps Code Project should produce a physical magazine. Hmmm. *strokes chin**
*No, not Chin.
|
|
|
|
|
IMHO, between the Daily Insider and the weekly Web Development and Mobile Development newsletters, we do a pretty good impression of a magazine given the resources at hand. But of course I say that as I put them together.
To put together a high-quality magazine these days, even an online-only one, is not a great business proposition. Hence the decline in quality and quantity of nerdy tomes on the newsstand. I should know: I worked in the dev pub biz until recently. Technically still do, and the Code Project is a good example of what still works.
Suggestion: the Code Project *is* a primary source for a lot of great writing in the dev sphere. But it's all written by the members here. If there's something you want to learn about, post your suggestion here in the forums. Maybe someone will write it. Maybe someone will help *you* write it, and you'll learn something in the process. "Win win" as the brogammers say.
(BTW, when I say "you" I don't mean AspDotNetDev in particular. I mean "y'all" in the Texan sense of the word.)
Director of Content Development, The Code Project
|
|
|
|
|
Once upon a time, Dr. Dobbs Journal was a favorite of mine. Now it appears to have gone entirely online. I can't speak to the cutting edge content it used to have, and may still have, since I haven't kept up with it in many years, but here's a sample: VS11 - Not Ready For Prime Time[^]
Will Rogers never met me.
|
|
|
|
|
|
|
MSDN magazine used to be quite good until it became a "Hey! Look at me blowing my trumpet with clever code and self-gratification."
|
|
|
|
|
I've just watched the series on Auntie about the Titanic which was presented by Len Goodman of Strictly Come Dancing fame. I don't know about you chaps that might have watched it, but he presented it really well, with sensitivity and subject knowledge. I looked forward to it each week and was sorry to see it was only three parts when it could have gone on for six or more.
Once again, Auntie produces another fine example of excellent original programming.
|
|
|
|
|
No Spoilers Please.
I don't want to know how it ends.
---------------------------------
I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave
CCC Link[ ^]
English League Tables - Live
|
|
|
|
|
Leslie Nielsen dies..
Lobster Thermidor aux crevettes with a Mornay sauce, served in a Provençale manner with shallots and aubergines, garnished with truffle pate, brandy and a fried egg on top and Spam - Monty Python Spam Sketch
|
|
|
|
|
Ah dagnabbit!
I was hoping for a whole series on it's many voyages.
---------------------------------
I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave
CCC Link[ ^]
English League Tables - Live
|
|
|
|