Modeling
-
Liskov Substitution Principle (LSP)Modeling/DesignPattern 2020. 2. 28. 00:51
1. Overview We should be to substitute base class objects with child class objects and this should not alter behavior/characteristics of the program. 2. Description For example, Java what we are also talking about behavioral subtypes. That means if the base class object was providing a specific behavior and if that base class object is now substituted with a child class object that behavior shou..
-
Parallel Algorithms and Sequential AlgorithmsModeling/TheoremParadigm 2020. 2. 27. 21:22
1. Overview In the case of Sequential algorithms, It should execute the tasks one after each other. In the case of Parallel algorithms, we execute different tasks with different processors then combine the results. Some problems are easy to parallelizable, other problems are completely sequential. 2. Description 2.1 Parallel algorithms Checking prime numbers in a range. We have to make subsets. ..
-
Locking Strategies and DeadlocksModeling/TheoremParadigm 2020. 2. 27. 01:37
1. Overview In concurrent computing, a deadlock is a state in which each member of a group is waiting for another member, including itself, to take action, such as sending a message or more commonly releasing a lock. Deadlock is a common problem in multiprocessing systems, parallel computing, and distributed systems, where software and hardware locks are used to arbitrate shared resources and im..
-
Resource Sharing, Critical Sections, and Atomic operationsModeling/Architecture 2020. 2. 27. 00:02
1. Overview Resource sharing is multi-thread architecture design. 2. Resource Sharing 2.1 What is a resource Variables (Integers, Strings, and etc.) Data Structures File or Connection handles Message or work queues Any Objects 2.2 Why share resources 2.2.1 Case 1 In this case, the benefit from sharing this data structure is that the document saver thread can save the user from losing his or her ..
-
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..
-
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..