https://developers.google.com/web-toolkit/articles/mvp-architectureに従いました。彼らのモデルでは、1 つのクラス「Contact」と、「ContactDetails」と呼ばれるそのクラスの軽量バージョンを使用しています。ライト バージョンはあまり必要ないので、ContactDetails を削除して Contact に置き換えました。
今、私は次のような例外に遭遇しました
Type 'org.eclipse.persistence.indirection.IndirectList' was not included in the set of types which can be serialized by this SerializationPolicy or its Class object could not be loaded. For security purposes, this type will not be serialized.: instance = {IndirectList: not instantiated}
その理由は、ここ (http://stackoverflow.com/a/6778986/1141785) でわかったように、Contact クラスは Persistence API 技術を使用するクラスであり、ネットワークに送信されるべきではないためです。
では、ContactDetails クラスは、ネットワーク経由で送信する必要がある私の DTO クラスですか? この余分なクラスの使用を避ける方法はありませんか?
「ライト」バージョンの使用を避けたい理由は、FieldUpdater を使用して DataGrid の Contact クラスを編集したいからです。
私の場合、DTO クラスを使用すると何か利点がありますか?
Contact および ContactDetails クラスに非常に多くのコードが重複するのを避けるにはどうすればよいでしょうか。