Welcome to CrankyGoblin.Com Sign in | Join | Help

Public Class GeoffAppleby

Inherits Microsoft.VisualBasic.MVP : Implements IBrainFart
I tried, I failed.

I was playing today with a feature I was sorta considering implementing. I wanted to implement it in a common base class, but that actually wasn't possible in this case - I really don't my guys at work to modify autogenerated classes (the code spat out when you make a web reference). If you mod it, it's fine - up until the point when you update the reference, and then you have to remember to make the same mod again. Not good.

So I looked at maybe requiring the devs to write a new class that inherits from the web reference class. Possible, but still annoying. Still means implementing the same code multiple times (once per web reference). For the same reason, I discarded waiting for Whidbey and using partial classes - it'd work, but I'm trying for code reuse.

Then I had a thought. Generics! I can do this with Generics! A common baseclass that can contain all the extra code I want, generated at compile time. So I wrote this:

Public Class Class1(Of V As System.Web.Services.Protocols.SoapHttpClientProtocol)
  Inherits V

End Class

How neat is this? I thought it was a fantastic idea.

Unfortunately, when you do this, you get this error: 'class 'Class1' cannot inherit from a type parameter'.

Once I thought about it it a bit more, I guess it sorta makes sense. You don't know if V is NotIneritable, MustInherit, or whatever. It would surely fail at compile time if that happened, but it's a lot safer to not allow this sort of thing to happen.

Disappointing though :)

Posted: Wednesday, August 17, 2005 9:17 AM by Geoff Appleby

Comments

TomCat said:

Nice solution.. too bad it didn't work. It's an interesting problem and I'm trying to find a solution too. what are the changes that you want to apply to the auto-generated references?
# August 17, 2005 10:46 AM

Geoff Appleby said:

I wanted to overload GetRequest and GetResponse so that I could detect as early as possible is a 401 condition had occurred. If i catch it there, and it's a desktop app, I can write into our core base libraries throwing up an authentication dialogue for a username and password, and regenerate the request without having to write controlling logic around each web method call.

I'm still thinking about it, but I've put it on the backburner for now with more important things to do :)
# August 17, 2005 7:28 PM

LeVaN said:

http://www.amator-porr.seksi-***.com ^^^ http://www.amator-porr-gratis.seksi-***.com ^^^ http://www.vergine-d.str0nz0.com ^^^ http://www.cuttier-lesbiche-***.str0nz0.com ^^^ http://www.maduras-mamadoras-film.100milfotos.com ^^^ http://www.jovencitas-inocentes.100milfotos.com ^^^ http://www.bambine-fanno-seghe-lesbica.allievo69.com ^^^ http://www.scopate-incesti-lesbica.allievo69.com ^^^ http://www.beibit-aasi-naida-kylvyssa.huor4.com ^^^ http://www.alushousuja.huor4.com ^^^ http://www.kiihkea-sihteeri-toiminta.hu0ra.com ^^^ http://www.blowjob.hu0ra.com ^^^ http://www.likeable-poliziotto-inculate.fott1.com ^^^ http://www.iostream-h.fott1.com ^^^ http://www.desiderio-cowgirl-strip.f0tti.com ^^^ http://www.sito-gratis-maschi-nudi.f0tti.com ^^^ http://www.prostituoitu-aneli.s3ksi.com ^^^ http://www.keksi-juustokakku-portto.s3ksi.com ^^^ http://www.cartoon-sexi.ragazza69.com ^^^ http://www.arancha-bonete-follando-porn.ragazza69.com ^^^ http://www.lesbe-drbizzarro.corneo69.com ^^^ http://www.avventuroso-zoccoleborghesi-***.corneo69.com ^^^ http://www.sexo-madre-follando.dibujitosporn.com ^^^ http://www.fighe-enormi-cuadro.dibujitosporn.com ^^^ http://www.fotolog-desnudos-hardcore.disponibile69.com ^^^ http://www.perverse-conos-belludos.disponibile69.com ^^^ http://www.voyerismo-cuadros.gayfrei.com ^^^ http://www.galerias-homosexsuales.gayfrei.com ^^^ http://www.cuadro-lesvianas-cogiendo.petarda2fotos.com ^^^ http://www.novias-enviadas.petarda2fotos.com ^^^ http://www.pajas-videos-gif.lesbianavideo.com ^^^ http://www.amateurs-sex.lesbianavideo.com ^^^ http://www.chochos-viejas-avi.pollonesamateur.com ^^^ http://www.mujer-asiatica-sexo.pollonesamateur.com ^^^ http://www.mpeg-iconos-guarros.sexoexnovia.com ^^^ http://www.bragas-sucias.sexoexnovia.com ^^^ http://www.fotos-chicas-hermosas.latinas-putas.com ^^^ http://www.galeria-de-brasileras.latinas-putas.com ^^^ http://www.lolitas-borrachas.putasmorochas.com ^^^ http://www.ejercito-argentino.putasmorochas.com ^^^

# November 28, 2006 1:09 AM
Leave a Comment

(required) 

(required) 

(optional)

(required) 

To submit your comment, click on these pictures:
  • Geoff's hand
  • Geoff with sunglasses
  • Geoff's mother on a booger hunt
Gaptcha Image - No Peeking! Gaptcha Image - No Peeking! Gaptcha Image - No Peeking!
Gaptcha Image - No Peeking! Gaptcha Image - No Peeking! Gaptcha Image - No Peeking!
Gaptcha Image - No Peeking! Gaptcha Image - No Peeking! Gaptcha Image - No Peeking!
Can't recognise the people in these pictures? Look here for a quick introduction.
There's a time limit for you to get your comment submitted before this set of pictures expires. If you think it's been longer than 10 minutes, get some new pictures first (you won't lose what you've typed so far).
Get some new pictures 

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS