전체 글16 Strategy 디자인패턴이란? 객체지향 프로그램 개발시 적용할 수 있는 방법론 필수적으로 지켜야하는 룰이 아니라, 수많은 개발자들의 경험과 아이디어가 모여서 집대성된 가이드라인 왜 필요한가? 프로그램을 개발할 때 동작은 되는데 이것이 정답인지 고민한 적이 없으신가요? 굉장히 많은 로직들이 뭉쳐져 있는 클래스를 유지보수하면서 힘드신 적이 없으셨나요? 신입일 때 java의 io 패키지를 다루면서 코드를 왜이렇게 써야하는지 궁금한 적이 없으셨나요? 디자인패턴은 추상화, 캡슐화, 다형성, 상속을 활용하여 확장이 용이한 프로그램을 설계하도록 도와줍니다. 디자인패턴을 배우고나면 io 패키지에 Decorator패턴이 적용되어 있다는 것을 깨닫게 됩니다. 종류? - Creational : 상황에 따른 알맞은 객체를 생성하는 방법 -.. 2022. 2. 17. Constructor and Object model In this post, we will figure out briefly what happens internally when we call a constructor. It will be needed necessary to understand JS object model and 'this' keyword later. 1. Review Definition of the constructor : - It is a function - It creates an instance and returns it Yes, the constructor is just a function. If we do not use 'new' keyword, it is just executed and finished without return.. 2019. 9. 4. Prototype Javascript is a 'prototype-based' language. As I referred to the previous post, it is very important to understand the concept of a prototype. 1. Review - All things in JS(except primitive type) are objects - A function is one of the objects - All Objects are created by constructor(instance) - When you define the function, JS delegates a constructor to function and create a prototype Let's start.. 2019. 9. 3. Function 1. What is a Function? Let's make it simple. It is just one of an object. A function consists of ‘name’, ‘argument’ and ‘expression’. Normally we define a function using a literal expression. function functionName(argument) { // express what this funtion does } But we can also use a constructor. Remind this: - An object has Property and method - A function is an object - All objects are created .. 2019. 9. 2. 이전 1 2 3 4 다음