Sunday, August 21, 2022

use React in MVC project

 install NuGet packages

React.AspNet
JavaScriptEngineSwitcher.V8
JavaScriptEngineSwitcher.Extensions.MsDependencyInjection

JavaScriptEngineSwitcher.V8.Native.win-x64 [old]
or
Microsoft.ClearScript.V8.Native.win-x64 [new]


Monday, August 8, 2022

Core Concept and Design Patterns

OOP core Concepts:

-Inheritance
-Encapsulation
-Polymorphism
-Data Abstraction


Abstract class: can't used directly, child class should inherit from abstract class and override the abstract methods.

Encapsulation means all the necessary data and methods are bind together and all the unnecessary details are hidden to the normal user. So Encapsulation is the process of binding data members and methods of a program together to do a specific job, without revealing unnecessary details.


Polymorphism (overload, override)
refers to the process by which some code, data, method, or object behaves differently under different circumstances or contexts.

For example, think of a base class called Animal that has a method called animalSound(). Derived classes of Animals could be Pigs, Cats, Dogs, Birds - And they also have their own implementation of an animal sound




How to prevent override? final keyword means I can't override this variable or method.