Skip to content

Commit cd1a193

Browse files
committed
ChangeController has access to UserDatabase, not the UI
1 parent bdbca90 commit cd1a193

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/UserModificationUI.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
public class UserModificationUI implements ChangeController{
1010
private JLabel label;
11-
UserDatabase db = UserDatabase(accounts);
1211
public UserModificationUI() {
1312
final JFrame frame = new JFrame();
1413
frame.setSize(1200, 100);
@@ -65,6 +64,7 @@ public void actionPerformed(ActionEvent e) {
6564
// ChangeController makes UI implement reportChange to invert the use-case --> UI dependency
6665
@Override
6766
public boolean reportChange(String username, String password, String feature, String newFeature) {
67+
UserDatabase db = UserDatabase(accounts);
6868
User user = db.getUser(username);
6969
if (user.getPassword().equals(password) && user.getUsername().equals(username)){
7070
user.changeFeature(feature, newFeature);

0 commit comments

Comments
 (0)