전략 패턴과 비슷한 개념인데 거기서 조금 더 생각한 패턴이다.
객체를 생성하는 코드를 한 객체 또는 메소드에 집어넣으면 코드에서 중복되는 내용을 ㅈ ㅔ거할 수 있고
나중에 관리할 때도 한 군데에만 신경을 쓰면 된다.
클라이언트 입자에서는 객체 인스턴스를 만들 때 구상 클래스가 아닌 인터페이스만 필요로 하게 된다. 이렇게 하면 구현이 아닌 인터페이스 바탕으로 프로그래밍을 할 수 있게 되고 유연성과 확장성이 뛰어나진다.

진짜 객체의 인스턴스를 만들 때는 여전히 구상 클래스를 사용해야 하는데 이것은 어쩔 수 없는 것이다.
하지만 이것을 이해하고 생성코드를 한 곳에 모아노고 체계적인 관리를 할 수 있는 설계를 한다면 관리하기 편리해진다. 객체 생성 코드를 아무곳에나 두면 결과를 얻기가 힘들어진다.

서브 클래스를 사용하고 최대한 new를 사용하지 않는다.
new를 사용하는 것이 구상 클래스를 호출하는 것이 된다.

객체 의존성>>
객체 인스턴스를 직접 만들면 구상 클래스에 의존해야 한다.
구상클래스에 의존하지 말고 추상화된 것에 의존하도록 한다.

인스턴스가 한개만 만들어지기 때문에 겹치는 부분이 없게 만들 수 있다.
만일 인스턴스가 두개 이상 만들어질 수 있다면
동시에 두 인스턴스의 내용이 바뀔 때 큰 혼란이 올 수 있다.
그래서 단 하나의 인스턴스가 만들어지면 다른 곳에서 호출 시 현재 실행 중인 인스턴스가 종료되고 다시 불려가는 것이다. ..
만일 중요한 순간에 종료되고 다른 곳에서 불려가서 정보가 바뀌면
까딱하다간 에러는 안나고 엄청난 결과를 초래할 수 있다.
우리가 프로세스를 사용할 때 쓰는 IPC와 비슷한 의미를 가지는거 같다 내가보기엔-ㅁ-

Linux User's Guide Contents Page
Linux Directory Structure
Note: Files are grouped according to purpose. Ex: commands, data files, documentation.

Parts of a Unix directory tree. See the FSSTND standard (Filesystem standard)

/ Root
|---root The home directory for the root user
|---home Contains the user's home directories
| |----ftp Users include many services as listed here
| |----httpd
| |----samba
| |----user1
| |----user2
|---bin Commands needed during bootup that might be needed by normal users
|---sbin Like bin but commands are not intended for normal users. Commands run by LINUX.
|---proc This filesystem is not on a disk. Exists in the kernels imagination (virtual). This directory
| | Holds information about kernel parameters and system configuration.
| |----1 A directory with info about process number 1. Each process
| has a directory below proc.
|---usr Contains all commands, libraries, man pages, games and static files for normal
| | operation.
| |----bin Almost all user commands. some commands are in /bin or /usr/local/bin.
| |----sbin System admin commands not needed on the root filesystem. e.g., most server
| | programs.
| |----include Header files for the C programming language. Should be below /user/lib for
| | consistency.
| |----lib Unchanging data files for programs and subsystems
| |----local The place for locally installed software and other files.
| |----man Manual pages
| |----info Info documents
| |----doc Documentation for various packages
| |----tmp
| |----X11R6 The X windows system files. There is a directory similar to usr below this
| | directory.
| |----X386 Like X11R6 but for X11 release 5
|---boot Files used by the bootstrap loader, LILO. Kernel images are often kept here.
|---lib Shared libraries needed by the programs on the root filesystem
| |----modules Loadable kernel modules, especially those needed to boot the system after
| disasters.
|---dev Device files for devices such as disk drives, serial ports, etc.
|---etc Configuration files specific to the machine.
| |----skel When a home directory is created it is initialized with files from this directory
| |----sysconfig Files that configure the linux system for networking, keyboard, time, and more.
|---var Contains files that change for mail, news, printers log files, man pages, temp files
| |----file
| |----lib Files that change while the system is running normally
| |----local Variable data for programs installed in /usr/local.
| |----lock Lock files. Used by a program to indicate it is using a particular device or file
| |----log Log files from programs such as login and syslog which logs all logins,
| | logouts, and other system messages.
| |----run Files that contain information about the system that is valid until the system is
| | next booted
| |----spool Directories for mail, printer spools, news and other spooled work.
| |----tmp Temporary files that are large or need to exist for longer than they should in
| | /tmp.
| |----catman A cache for man pages that are formatted on demand
|---mnt Mount points for temporary mounts by the system administrator.
|---tmp Temporary files. Programs running after bootup should use /var/tmp.

+ Recent posts