1

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?

3
  • 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 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. Feb 22 '13 at 5:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.