Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

Say you have

class A {
}

class B {
}

One type dependency is "method parameter":

class A {
}

class B {
  public void M(A a) {
  }
}

Another is "method returns":

class A {
}

class B {
  public A M() {
  }
}

Then C, an adapter from A to B, could be identified by a class that exhibits both of the above dependency characteristics:

class C {
  public B M(A a) {
  }
}

I just seems like something that could be approached with some formal methods and I'd be interested to read about them if they are out there?

share|improve this question
    
There are various kinds of type systems which may have other forms of relationships not possible in the java/C# style type system. You didn't mention generic constraint as a type dependency, and the language you refer to doesn't have parametric polymorphism which opens up more types of relationships. There may be a valid enumeration as you're referring to that is the set of possible type relationships in language X or Y, but the set of possible relationships in the set of type systems/languages which includes all of them is likely never been enumerated outside of type theorists –  Jimmy Hoffa Feb 22 '13 at 5:27
    
    
another approach which may actually have documentation out there would be to recognize a type as a set, and then try and identify if there can be homomorphic/isomorphic/endomorphic/monomorphic etc relationships between the types given the type system available. –  Jimmy Hoffa Feb 22 '13 at 5:38

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.