mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-05-15 06:58:41 +00:00
deps: Refactor dependencies (#3224)
* remove spring dep move junit, logging, mockito under dep mgmt * upgrade anti-corruption-layer deps * async method invocation * balking, bloc * bridge to bytecode * caching * callback - cqrs * component - health check * hexagonal - metadata mapping * rest of the patterns * remove checkstyle, take spotless into use
This commit is contained in:
@@ -25,9 +25,7 @@
|
||||
|
||||
package com.iluwatar.virtual.proxy;
|
||||
|
||||
/**
|
||||
* The main application class that sets up and runs the Virtual Proxy pattern demo.
|
||||
*/
|
||||
/** The main application class that sets up and runs the Virtual Proxy pattern demo. */
|
||||
public class App {
|
||||
/**
|
||||
* The entry point of the application.
|
||||
@@ -36,7 +34,7 @@ public class App {
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
ExpensiveObject videoObject = new VideoObjectProxy();
|
||||
videoObject.process(); // The first call creates and plays the video
|
||||
videoObject.process(); // Subsequent call uses the already created object
|
||||
videoObject.process(); // The first call creates and plays the video
|
||||
videoObject.process(); // Subsequent call uses the already created object
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,9 +24,7 @@
|
||||
*/
|
||||
package com.iluwatar.virtual.proxy;
|
||||
|
||||
/**
|
||||
* Interface for expensive object and proxy object.
|
||||
*/
|
||||
/** Interface for expensive object and proxy object. */
|
||||
public interface ExpensiveObject {
|
||||
void process();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,9 +28,7 @@ package com.iluwatar.virtual.proxy;
|
||||
import lombok.Getter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* Represents a real video object that is expensive to create and manage.
|
||||
*/
|
||||
/** Represents a real video object that is expensive to create and manage. */
|
||||
@Slf4j
|
||||
@Getter
|
||||
public class RealVideoObject implements ExpensiveObject {
|
||||
@@ -47,4 +45,4 @@ public class RealVideoObject implements ExpensiveObject {
|
||||
public void process() {
|
||||
LOGGER.info("Processing and playing video content...");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,7 +28,8 @@ package com.iluwatar.virtual.proxy;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* A proxy class for the real video object, providing a layer of control over the object instantiation.
|
||||
* A proxy class for the real video object, providing a layer of control over the object
|
||||
* instantiation.
|
||||
*/
|
||||
@Getter
|
||||
public class VideoObjectProxy implements ExpensiveObject {
|
||||
@@ -41,4 +42,4 @@ public class VideoObjectProxy implements ExpensiveObject {
|
||||
}
|
||||
realVideoObject.process();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user