Click here to Skip to main content
15,889,462 members
Home / Discussions / C#
   

C#

 
GeneralRe: how to get wsdl using wse 2.0 in short Pin
4-Jul-05 3:09
suss4-Jul-05 3:09 
QuestionAre there any issues with connecting to the ORACLE 10g database through C# .Net? Pin
suvarna joshi1-Jul-05 3:16
suvarna joshi1-Jul-05 3:16 
GeneralUrgent Integration of Windows Service setup with my project Pin
ksanju10001-Jul-05 1:50
ksanju10001-Jul-05 1:50 
GeneralEvent fired on killing an application fromTaskManager Pin
manivannan.p1-Jul-05 1:44
manivannan.p1-Jul-05 1:44 
GeneralRe: Event fired on killing an application fromTaskManager Pin
Dave Kreskowiak1-Jul-05 3:46
mveDave Kreskowiak1-Jul-05 3:46 
GeneralRe: Event fired on killing an application fromTaskManager Pin
manivannan.p1-Jul-05 22:12
manivannan.p1-Jul-05 22:12 
GeneralRe: Event fired on killing an application fromTaskManager Pin
Dave Kreskowiak2-Jul-05 16:31
mveDave Kreskowiak2-Jul-05 16:31 
GeneralRational for Generics? Proposal for change Pin
Nick Hounsome1-Jul-05 0:10
Nick Hounsome1-Jul-05 0:10 
Does anyone know of a detailed rational of the choices and decisions made in implementing generics in C# 2.0?

There are good reasons why Generics are not implemented as C++ templates but in some areas it seems that some aspects of the C++ method could have been implemented and would have been superior.

The difference that most concerns me is that with C++, template methods are (normaly) only instantiated if they are referenced and this allows templates to support extra functionality if the parametric class supports it.

For example: I want to create a general struct Pair<T1,T2>. I must immediately decide whether or not it is IComparable and this depends on whether or not its type parameters are constrained to be IComparable.

I no see reason (other than devising a syntax) why implementation of the interface should not be conditional on a where clause restriction on the parametric types.

The parametric restriction of methods is even simpler in principle since a syntax already exists for generic methods that would just need to be extended to allow reference to the parametric types of the class - If the class parameters did not satisy the where clause then the method would not exist and couldn't be called.

A very simple example of my idea:
// Pair<T> is IComparable if and only if T is.
// new bracketing syntax is required to indicate that the constraint applies
// only to the implementation or not of the interface
class Pair<T> : (IComparable where T: IComparable)
{
    T first;
    T second;

    // This method would only exist if T was IComparable
    // The syntax and meaning is the same as for ordinary template 
    // methods except the class parameter is used.
    public int CompareTo(object other) where T: IComparable
    {
        int r1 = first.CompareTo(other.first);
        return r1 != 0 
            ? r1 
            : second.CompareTo(other.second);
    }

    //....
}


Obviously the compiler would have to verify that the constraints on the interface gaurantee the constraints on the methods needed to implement it.
GeneralRe: Rational for Generics? Proposal for change Pin
Judah Gabriel Himango1-Jul-05 5:25
sponsorJudah Gabriel Himango1-Jul-05 5:25 
GeneralRe: Rational for Generics? Proposal for change Pin
Nick Hounsome1-Jul-05 9:26
Nick Hounsome1-Jul-05 9:26 
GeneralRe: Rational for Generics? Proposal for change Pin
Judah Gabriel Himango1-Jul-05 9:40
sponsorJudah Gabriel Himango1-Jul-05 9:40 
GeneralSOAPFormatter and &#229;&#228;&#246; Pin
Roger Alsing30-Jun-05 22:36
Roger Alsing30-Jun-05 22:36 
Generalexecute external program from a C# program Pin
StrayGrey30-Jun-05 22:23
StrayGrey30-Jun-05 22:23 
GeneralRe: execute external program from a C# program Pin
Weiye Chen30-Jun-05 22:47
Weiye Chen30-Jun-05 22:47 
GeneralRe: execute external program from a C# program Pin
StrayGrey30-Jun-05 22:49
StrayGrey30-Jun-05 22:49 
GeneralRe: execute external program from a C# program Pin
Weiye Chen30-Jun-05 23:02
Weiye Chen30-Jun-05 23:02 
GeneralRe: execute external program from a C# program Pin
StrayGrey4-Jul-05 20:56
StrayGrey4-Jul-05 20:56 
QuestionHow to get WSDL using WSE 2.0 Pin
iffi raja30-Jun-05 22:16
sussiffi raja30-Jun-05 22:16 
QuestionHow to change default Image of Cursor? Pin
pubududilena30-Jun-05 22:13
pubududilena30-Jun-05 22:13 
Generalsetting allowzerolength in an access DB with C# Pin
Anonymous30-Jun-05 22:00
Anonymous30-Jun-05 22:00 
QuestionHow to call C++ DLL from c#.Net Pin
amrutajoshi30-Jun-05 21:52
amrutajoshi30-Jun-05 21:52 
AnswerRe: How to call C++ DLL from c#.Net Pin
Corinna John1-Jul-05 0:18
Corinna John1-Jul-05 0:18 
GeneralRe: How to call C++ DLL from c#.Net Pin
amrutajoshi1-Jul-05 22:17
amrutajoshi1-Jul-05 22:17 
QuestionHow to use DataGrid Control in C# Pin
A H Khan30-Jun-05 21:34
A H Khan30-Jun-05 21:34 
AnswerRe: How to use DataGrid Control in C# Pin
V.30-Jun-05 22:46
professionalV.30-Jun-05 22:46 

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.