Skip to content

Conversation

@robotdorog
Copy link
Owner

No description provided.

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Файлы из .idea не исчезли, посмотри пример в предыдущем репозитории

src/Cryptor.java Outdated
str = reader.readLine();

} catch (Exception e) {
e.printStackTrace();
Copy link

@rs-pluss rs-pluss Oct 3, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Исключения, которые не можешь обработать, надо пробрасывать выше

… и reader. Убрал из класса Cryptor пути. Пути принимаются в параметрах метода
@@ -0,0 +1,60 @@
public class CryptorV2 {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Очень много общего между Cryptor и CryptorV2, как можно выделить общую идею?


String fileIn;
String fileOut;
CryptorViaString cryptorViaString;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Этих ребят здесь не должно быть


public class TestClass implements Crypt {

public TestClass(CryptorViaString cryptorViaString, CryptorViaStringBuilder cryptorViaStringBuilder){
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Почему пустой конструктор? Ты должен обе этих переменных запомнить в поля класса

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Исправил

@@ -0,0 +1,4 @@
public interface Crypt {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Crypt - глагол если я не ошибаюсь, этот интерфейс у тебя описывает сервис. Поэтому здесь должно быть существительное - Cryptor

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Переименовал на Cryptor

@@ -0,0 +1,40 @@
import java.io.IOException;

public class Cryptor implements Crypt {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Это сервис и для него правильно - Cryptor. Только вот он же не просто шифровальщик а с некоторой изюминкой, надо отразить это в названии.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Переименовал на CryptorWithTimeAssessment

CryptorViaStringBuilder cryptorViaStringBuilder;

public Cryptor(CryptorViaString cryptorViaString, CryptorViaStringBuilder cryptorViaStringBuilder) {
this.cryptorViaString = cryptorViaString;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Не вижу чтобы ты его использовал и сравнивал время выполнения. Сейчас ты используешь только второй

import java.nio.file.Path;

public class FileHandler {
Cryptor cryptor;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Этому классу должно быть без разницы, с какой реализацией интерфейса работать. Здесь нужно принимать максимально абстрактную сущность

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants