Hej,
Treść tego co chciałbym zrobić:
Fundusz składa się z:
-ID
-Nazwy
-Rodzaju
3 Rodzaje funduszy
-Polski
-Zagraniczny
-Pieniężny
3 Profile investowania
-Bezpieczny - 20% Polskie, 75% Zagraniczne, 5% Pieniężne
-Zrównoważony - 30% Polskie, 60% Zagraniczne, 10% Pieniężne
-Agresywny - 40% Polskie, 20% Zagraniczne, 40% Pieniężne
Rozbiłem sobie na klasy:
public class Fund {
private Long Id;
private String Name;
private FundType type;
public enum FundType {
POLAND,
FOREING,
MONETARY;
}
public enum ProfileOfInvesting {
SAFE(20, 75, 5),
BALANCED(30, 60, 10),
AGGRESSIVE(40, 20, 40);
private final int poland;
private final int foreing;
private final int monetary;
private ProfileOfInvesting(int poland, int foreing, int monetary) {
this.poland = poland;
this.foreing = foreing;
this.monetary = monetary;
}
public int getPoland() {
return poland;
}
public int getForeing() {
return foreing;
}
public int getMonetary() {
return monetary;
}
}
Czy takie rozbicie jest prawidłowe, najbardziej zastanawiają mnie te profile inwestowania. Czy w prawidłowy sposób to zrobiłem ?
Jestem ciekawy co powiecie @jarekr000000 @Shalom @scibi92 @Koziołek