Skip to content

Violación 2-DIP: DataBase.java instancia clases directamente #26

Description

@gabygomm

Solución propuesta:
Definir interfaces y usarlas como dependencias.

Código propuesto:

public interface IValidation {
    boolean checkInputPathFile();
    // otros métodos
}
public interface IFileManager {
    void writeNewContent(String filePath, String content);
}
public class DataBase {
    private IValidation validation;
    private IFileManager fileManager;
    // ...
}

UML propuesto:

classDiagram
    class DataBase { -IValidation validation -IFileManager fileManager }
    class IValidation { <<interface>> }
    class IFileManager { <<interface>> }
    DataBase o-- IValidation
    DataBase o-- IFileManager
Loading

Gómez S.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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