Добавил примеры для дебага

This commit is contained in:
Struchkov Mark 2022-02-19 07:36:26 +03:00
parent aec1f4f0b4
commit e9604fb62c
12 changed files with 44 additions and 40 deletions

View File

@ -3,16 +3,11 @@ package dev.struchkov.example.debugger.four;
public class ExampleFour {
public static void main(String[] args) {
final ThirdService thirdService = new ThirdService();
final SecondService secondService = new SecondService(thirdService);
final FirstService firstService = new FirstService(secondService);
final ThreadExample one = new ThreadExample("Первый");
final ThreadExample two = new ThreadExample("Второй");
final Entity entity = new Entity("Dasha");
firstService.processing(entity);
System.out.println();
System.out.println(entity);
System.out.println();
new Thread(one).start();
new Thread(two).start();
}
}

View File

@ -1,4 +1,4 @@
package dev.struchkov.example.debugger.three;
package dev.struchkov.example.debugger.four;
public class ThreadExample implements Runnable {

View File

@ -5,8 +5,8 @@ public class ExampleOne {
public static void main(String[] args) {
final PersonService personService = new PersonService();
demoOne(personService);
// demoTwo(personService);
// demoOne(personService);
demoTwo(personService);
}
private static void demoOne(PersonService personService) {
@ -15,6 +15,10 @@ public class ExampleOne {
personService.showAllPerson();
}
private static String getIvanovName() {
return "Иванов";
}
private static void demoTwo(PersonService personService) {
personService.showAllPerson();
personService.correctDeleteAllByLastName("Скворцова");

View File

@ -1,4 +1,4 @@
package dev.struchkov.example.debugger.four;
package dev.struchkov.example.debugger.three;
public class Entity {

View File

@ -0,0 +1,18 @@
package dev.struchkov.example.debugger.three;
public class ExampleThree {
public static void main(String[] args) {
final ThirdService thirdService = new ThirdService();
final SecondService secondService = new SecondService(thirdService);
final FirstService firstService = new FirstService(secondService);
final Entity entity = new Entity("Dasha");
firstService.processing(entity);
System.out.println();
System.out.println(entity);
System.out.println();
}
}

View File

@ -1,4 +1,4 @@
package dev.struchkov.example.debugger.four;
package dev.struchkov.example.debugger.three;
import dev.struchkov.example.debugger.box.SurpriseException;

View File

@ -1,4 +1,4 @@
package dev.struchkov.example.debugger.four;
package dev.struchkov.example.debugger.three;
public class SecondService {

View File

@ -1,4 +1,4 @@
package dev.struchkov.example.debugger.four;
package dev.struchkov.example.debugger.three;
public class ThirdService {

View File

@ -1,13 +0,0 @@
package dev.struchkov.example.debugger.three;
public class TreadMain {
public static void main(String[] args) {
final ThreadExample one = new ThreadExample("Первый");
final ThreadExample two = new ThreadExample("Второй");
new Thread(one).start();
new Thread(two).start();
}
}

View File

@ -0,0 +1,10 @@
package dev.struchkov.example.debugger.two;
public class ExampleTwo {
public static void main(String[] args) {
final FooService fooService = new FooService();
fooService.example();
}
}

View File

@ -2,7 +2,7 @@ package dev.struchkov.example.debugger.two;
import dev.struchkov.example.debugger.box.SurpriseBox;
public class ForExample {
public class FooService {
public void example() {
for (int i = 0; i < 1000; i++) {

View File

@ -1,10 +0,0 @@
package dev.struchkov.example.debugger.two;
public class Main {
public static void main(String[] args) {
final ForExample forExample = new ForExample();
forExample.example();
}
}