Skip to content

SOLID recomendation #14

@randyRivera0

Description

@randyRivera0

SRP problem
public class ApplicationController implements Initializable {

@FXML
private AnchorPane createAccountPane; // Reference to the account creation form

@FXML
private H1 h1CreateAccount; // Reference to the h1 element for potential styling

// Other fields and methods

@Override
public void initialize(URL url, ResourceBundle rb) {
    // ... (initialization logic)

    createAccountPane.setVisible(false); // Initially hide the form
}

public void showCreateAccountForm() {
    createAccountPane.setVisible(true); // Make the form visible
}

public void handleCreateAccount(ActionEvent event) {
    // Get form input values (username, password, etc.)
    String username = usernameField.getText();
    String password = passwordField.getText();

    // Validate input and create account logic
    if (isValidInput(username, password)) {
        // Create account using username and password
        createAccount(username, password);
        // Show success message or redirect to another view
        createAccountPane.setVisible(false); // Hide the form
    } else {
        // Display error messages to the user
    }
}

// ... other methods (isValidInput, createAccount, etc.)

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions