以下是我的領域類RequestFactory與值類型的接口/抽象類
class Person {
String getName();
Vehicle getVehicle();
}
interface Vehicle {
String getCompanyName();
String getRegNo();
Point getParkingSpaceRequired();
}
abstract class AbstractVehicle {
}
class Motorcycle extends AbstractVehicle {
}
class Car extends AbstractVehicle {
}
創建PersonProxy作爲EntityProxy是直線前進,併爲person.getName()工作的罰款
我已經創建VehicleProxy爲ValueProxy並用.with('vehicle')調用fire() 但是我收到錯誤:
域類型com .... AbstractVehicle $$ EnhancerByCGLIB $$ e86549b9無法發送到客戶端。
在PersonProxy 我@ProxyFor(值= Person.class,定位器= PersonLocator.class)
在VehicleProxy我@ProxyFor(值= Vehicle.class)
所以,如何處理這樣的RequestFactory中的繼承?
我是否應該將Vehicle從ValueProxy更改爲EntityProxy?
那麼如何實現VehicleLocator的方法?
那麼PersonProxy的getVehicle()應該返回什麼?車輛? 和MotorcycleProxy應該擴展Vehicle接口嗎?或者我應該有VehicleProxy? – Nachiket
對,我錯過了這部分 - 對不起。請看看我的編輯。 –