Business object / Data object design

V

VisionSet

Please comment on this approach to business object and data object:

public interface DataInfo {
public Object[] getData();
}

public class Record implements DataInfo {
public static final int FIELD_ONE = 0;
private String[] data;

public Object[] getData() {
return data;
}

public String getFieldOne() {
return data[FIELD_ONE];
}
}

If I'm in an application layer that requires business knowledge I use the
Record type, otherwise the DataInfo type is used. What are the drawbacks of
this proposal?
I think the usual approach is to use composition, a data object wrapped in a
business object.

TIA
 
V

VisionSet

public class Record implements DataInfo {
public static final int FIELD_ONE = 0;
private String[] data; ....
I think the usual approach is to use composition, a data object wrapped in a
business object.

Don't know why I wrote that last bit.
Record is composed of the Data object - String[] data !
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top