This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package dao; | |
public class DocumentoArquivo implements DocumentoDAO { | |
@Override | |
public void salvar() { | |
System.out.println("Salvando documento em um arquivo"); | |
} | |
@Override |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package dao; | |
public class DocumentoArquivo implements DocumentoDAO { | |
@Override | |
public void salvar() { | |
System.out.println("Salvando documento em um arquivo"); | |
} | |
@Override |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package dao; | |
public class DocumentoArquivo implements DocumentoDAO { | |
@Override | |
public void salvar() { | |
System.out.println("Salvando documento em um arquivo"); | |
} | |
@Override |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import dao.DocumentoArquivo; | |
import dao.DocumentoDAOImpl; | |
import service.DocumentoServiceImpl; | |
public class Main { | |
public static void main(String[] args) { | |
DocumentoServiceImpl documentoService = new DocumentoServiceImpl(new DocumentoDAOImpl()); | |
documentoService.salvar(); | |
documentoService.deletar(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package dao; | |
public class DocumentoArquivo implements DocumentoDAO { | |
@Override | |
public void salvar() { | |
System.out.println("Salvando documento em um arquivo"); | |
} | |
@Override |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package service; | |
import dao.DocumentoDAO; | |
public class DocumentoServiceImpl { | |
private DocumentoDAO documentoDAO; | |
public DocumentoServiceImpl(DocumentoDAO documentoDAO) { | |
this.documentoDAO = documentoDAO; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package dao; | |
public class DocumentoDAOImpl implements DocumentoDAO { | |
public void salvar() { | |
System.out.println("Salvando seu documento na base de dados"); | |
} | |
public void deletar() { | |
System.out.println("Deletando seu documento da base de dados"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package service; | |
import dao.DocumentoDAOImpl; | |
public class DocumentoServiceImpl { | |
private DocumentoDAOImpl documentoDAO = new DocumentoDAOImpl(); | |
public void salvar() { | |
System.out.println("Enviando seu documento para ser salvo"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import dao.DocumentoArquivo; | |
import dao.DocumentoDAOImpl; | |
import service.DocumentoServiceImpl; | |
public class Main { | |
public static void main(String[] args) { | |
DocumentoServiceImpl documentoService = new DocumentoServiceImpl(); | |
documentoService.salvar(); | |
documentoService.deletar(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package dao; | |
public class DocumentoDAOImpl { | |
public void salvar() { | |
System.out.println("Salvando seu documento na base de dados"); | |
} | |
public void deletar() { | |
System.out.println("Deletando seu documento da base de dados"); |