A
andymconline
Hello all,
Would the following be considered bad practice...
I have a very simple bean called "SimpleTypeBean" which is constructed
as follows:
public class SimpleTypeBean {
private long id;
private String description;
public SimpleTypeBean() {
}
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
}
I then need to declare a very similar bean (in fact, it is identical
in terms of data types), except one of the identifiers is called lob
not id, so I have done the following:
public class LobBean extends SimpleTypeBean {
public LobBean() {
}
public long getLob() {
return super.getId();
}
public void setLob(long lob) {
super.setId(lob);
}
}
Is this considered bad practice or is this what I should be doing?
Many Thanks
Andy
Would the following be considered bad practice...
I have a very simple bean called "SimpleTypeBean" which is constructed
as follows:
public class SimpleTypeBean {
private long id;
private String description;
public SimpleTypeBean() {
}
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
}
I then need to declare a very similar bean (in fact, it is identical
in terms of data types), except one of the identifiers is called lob
not id, so I have done the following:
public class LobBean extends SimpleTypeBean {
public LobBean() {
}
public long getLob() {
return super.getId();
}
public void setLob(long lob) {
super.setId(lob);
}
}
Is this considered bad practice or is this what I should be doing?
Many Thanks
Andy