java - Should I split up my XStream converter per class? -


i working on program uses xstream write out xml. stands have 1 class implements converter. single converter takes in entire configuration hashmap @ root , value of each key new instance of vmwareserver class in turn has hashmap value of key new instance of vmwarevirtualmachine class. each of respective classes have methods setting , getting things ip address , port number.

what wondering if proper way implement xstream converter, or should create separate converter convert each class xml on own?

i can show code if there still questions mean.

this debatable, argue having separate converter each class. has several benefits: if later need return subset of complete view, able decompose structure along class-based lines (perhaps, example, limit information permissions). if need return different representations in different contexts, can on class-by-class basis rather duplicating of presentational logic in monolithic class.


Comments

Popular posts from this blog

android - getbluetoothservice() called with no bluetoothmanagercallback -

sql - ASP.NET SqlDataSource, like on SelectCommand -

ios - Undefined symbols for architecture armv7: "_OBJC_CLASS_$_SSZipArchive" -