분류 전체보기
-
Metric of PerformanceTestMetric 2020. 2. 26. 17:54
1. Overview Network or Multithreading performance refers to measures of service quality of a network as seen by the customer or modules. 2. Description 2.1 Latency The time to completion of a task. Measured in time units. Theoretical reduction of latency by N = Performance improvement by a factor of N. What is N? How many subtasks/threads to break the original task? On a general-purpose computer..
-
Atomic VariablesStaticPL/JAVA 2020. 2. 26. 12:34
1. Overview A small toolkit of classes that support lock-free thread-safe programming on single variables. In essence, the classes in this package extend the notion of volatile values, fields, and array elements to those that also provide an atomic conditional update operation of the form 2. Example public class demo { public static void main(String[] args) throws InterruptedException { Inventor..
-
Open-Closed Principle (OCP)Modeling/DesignPattern 2020. 2. 26. 01:46
1. Overview Software entities such as Classes, Modules, Methods, and etc, should be open for extension but closed for modification. 2. Intuition Open for Extension: Extend existing behavior Closed for Modification: Existing code remains unchanged 3. Example 3.1 Violate OCP abstract class Subscriber {} class CallHistory { public static class Call { private LocalDateTime begin; private long durati..
-
Single Responsibility Principle (SRP)Modeling/DesignPattern 2020. 2. 26. 00:45
1. Overview There should never be more than one reason for a class to change. A class is focused, single functionality, and addresses a specific concern. 2. Intuition Guess an AwesomeClass which have communication protocol, message format, and authentication. When we have to change every HTTP to HTTPS, JSON to XML, and authentication, AwesomeClass should be changed. So Single Responsibility mean..
-
StateModeling/DesignPattern 2020. 2. 26. 00:43
1. Overview State pattern is a behavioral software design pattern that allows an object to alter its behavior when its internal state changes. This pattern is close to the concept of finite-state machines. The state pattern can be interpreted as a strategy pattern, which is able to switch a strategy through invocations of methods defined in the pattern's interface. State design pattern allows ou..
-
StrategyModeling/DesignPattern 2020. 2. 26. 00:42
1. Overview Strategy pattern allows us to encapsulate an algorithm in a class. So we can configure our context or main object with an object of this class, to change the algorithm used to perform given operation. This is helpful if you have many possible variations of an algorithm. A good indication for the applicability of strategy pattern is if we find different algorithms/behaviors in our met..
-
PrototypeModeling/DesignPattern 2020. 2. 26. 00:41
1. Overview We have a complex object that is costly to create. To create more instances of such class, we use an existing instance as our prototype. Prototype will allow us to make copies of the existing objects and save us from having to recreate objects from scratch. 2. Description 2.1 Implementation Prototype class must implement Cloneable interface Prototype Class should override the clone m..
-
FacadeModeling/DesignPattern 2020. 2. 24. 22:03
1. Overview Facade is an object that serves as a front-facing interface masking more complex underlying or structural code. A facade can: Improve the readability and usability of a software library by masking interaction with more complex components behind a single (and often simplified) API Provide a context-specific interface to more generic functionality (complete with context-specific input ..