The recent sudden thought of the OC object model is relatively clear, then C + +, Java How to implement it?
Reference documents:
http://www.cnblogs.com/skynet/p/3343726.html Wu Qin (Tyler) C + + object model
http://blog.csdn.net/jamesmf/article/details/7710149
1. First, easy to understand, generic implementation?
C + + generics, using compile-time processing, add the corresponding function name + parameter name, run-time direct call;
Java generics, pseudo generics, compile-time type checking, and so on, when the JVM actually loads class, it takes type erase (the generated class file is the original type of data)
OC None
2. Single Inheritance
1.c++ Inheritance (more complex), first assumed to be simple single inheritance, no overwrite, no multiple inheritance, no virtual inheritance.
Basic model: Virtual function table pointer + non-static data internal deposit element (continuous)
No overwrite: base class is not affected the virtual function table of directly expanding subclasses (late Father class, later subclass virtual function)
2.java inheritance to be continued ....
3. OC inheritance, OC The actual model is a struct, including class object and Meta class (seemingly somewhat similar to Java), each object contains super and Isa pointers, pointing to the parent class address and the object pointer, respectively
Cond....
Comparison of C + +, Java, OC object Models (Dry goods)