????ParticipantsInDB??????DBTable????????????????????????????????DBTable?????????????DBTable??clear?? getConn?? getTableName ????????

?????????delegation??

?????????????????????ParticipantsInDB??clear???????????????????????DBTable??clear???????????????????????ParticipantsInDB??????????м??????????DBTable?????????????????????????м??С??????delegation??????

?????????????bug??????????????????

ParticipantsInDB partsInDB = ...;
Participant kent = new Participant(...);
Participant paul = new Participant(...);
partsInDB.clear();
partsInDB.addParticipant(kent);
partsInDB.addParticipant(paul);
partsInDB.deleteParticipant(kent.getId());
//?????????????ParticipantsInDB??????????getCount??????????
System.out.println("There are "+partsInDB.getCount()+ "participants");


?????????£??????????????ParticipantsInDB ?? DBTableIn?????м?й??????????????????????????????С??????????????????????????DBTable????Щ????????????????????public??????????clear????????????????????е??????????????DBTable?????????public???????????????

????????????????????????

????????????????????????????????????Component???????GUI???????簴????????????????????????????????

abstract class Component {
boolean isVisible;
int posXInContainer;
int posYInContainer;
int width;
int height;
...
abstract void paint(Graphics graphics);
void setWidth(int newWidth) {
...
}
void setHeight(int newHeight) {
...
}
}
class Button extends Component {
ActionListener listeners[];
...
void paint(Graphics graphics) {
...
}
}
class Container {
Component components[];
void add(Component component) {
...
}
}


??????????????д??????clock????????????????????????????ε??????θ????????????λ??????????????????????????GUI?????????????????????????Component??

class ClockComponent extends Component {
...
void paint(Graphics graphics) {
//????????????????????
}
}

$news-page$

??????????????????????????????????????ε??????????????????Component??width??height???????????setWidth ?? setHeight??Щ??????????Щ???????????ε???????????????

?????????????????????????????????????????????????????????м?й????ClockComponent?????Component????????????Compoent??????Button???????????

??????ParticipantsInDB??????????????????????ò?????ClockComponent????????Component??????????????????????????????????Container?С???????????????????Component?????????á??????????

????????????Component??????width?? height?? setWidth ?? setHeight??Щ????????y?????????????Component?????????????????????????????????????????????????е?????????????????????????ClockComponent?????????

??????????????????????????????е??????е???????????????????????????????

?????????г??????????Щ?????

????????????????Component???????????????????????????Щ??????Button????????????????????????????Щ????????????????ε????

??????????е??????????????RectangularComponent????????width??height??setWidth??setHeight?????????????Button??????????

abstract class Component {
boolean isVisible;
int posXInContainer;
int posYInContainer;
...
abstract void paint(Graphics graphics);
}
abstract class RectangularComponent extends Component {
int width;
int height;
void setWidth(int newWidth) {
...
}
void setHeight(int newHeight) {
...
}
}
class Button extends RectangularComponent {
ActionListener listeners[];
...
void paint(Graphics graphics) {
...                     }
}
class ClockComponent extends Component {
...
void paint(Graphics graphics) {
//????????????????????
}
}