분류 전체보기
-
Stack and Heap Memory RegionsModeling/Architecture 2020. 2. 26. 23:36
1. Overview 2. Stack 2.1 What is allocated in Stack Methods are called Arguments are passed Local variables are stored Stack + Instruction Pointer = State of each thread's execution 2.2 Example 2.3 Properties All variables belong to the thread executing on that stack Statistically allocated when the thread is created The stack's size is fixed, and relatively small which depends on the specific p..
-
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..