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

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 class ExampleFour {
public static void main(String[] args) { public static void main(String[] args) {
final ThirdService thirdService = new ThirdService(); final ThreadExample one = new ThreadExample("Первый");
final SecondService secondService = new SecondService(thirdService); final ThreadExample two = new ThreadExample("Второй");
final FirstService firstService = new FirstService(secondService);
final Entity entity = new Entity("Dasha"); new Thread(one).start();
firstService.processing(entity); new Thread(two).start();
System.out.println();
System.out.println(entity);
System.out.println();
} }
} }

View File

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

View File

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

View File

@@ -1,4 +1,4 @@
package dev.struchkov.example.debugger.four; package dev.struchkov.example.debugger.three;
public class Entity { 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; 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 { public class SecondService {

View File

@@ -1,4 +1,4 @@
package dev.struchkov.example.debugger.four; package dev.struchkov.example.debugger.three;
public class ThirdService { 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; import dev.struchkov.example.debugger.box.SurpriseBox;
public class ForExample { public class FooService {
public void example() { public void example() {
for (int i = 0; i < 1000; i++) { 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();
}
}