반응형
반응형
본문 바로가기

공부/Object-Oriented Design Pattern27

Prototype Pattern (프로토타입 패턴)이란 Prototype Pattern (프로토타입 패턴)이란 Copy and change rather than creating with new; Creating with new is costly; Copy general properties, and change necessary part; Prototype is a creational design pattern that lets you copy existing objects without making your code dependent on their classes. Problem Say you have an object, and you want to create an exact copy of it. How would you do it? First, you h.. 2021. 5. 19.
Visitor Pattern (방문자 패턴)이란 Visitor Pattern (방문자 패턴)이란 출처 : refactoring.guru/design-patterns/visitor Visitor is a behavioral design pattern that lets you separate algorithms from the objects on which they operate. 방문자는 알고리즘을 동작하는 개체와 분리할 수 있는 동작 설계 패턴입니다. Problem Imagine that your team develops an app which works with geographic information structured as one colossal graph. Each node of the graph may represent a complex en.. 2021. 5. 11.
Factory Method Pattern (팩토리 메소드 패턴) Factory Method Pattern (팩토리 메소드 패턴) 출처 : www.tutorialspoint.com/design_pattern/factory_pattern.htm 출처 : www.javatpoint.com/factory-method-design-pattern 출처: www.journaldev.com/1392/factory-design-pattern-in-java 출처 : refactoring.guru/design-patterns/factory-method Factory Method / Design Patterns / Creational Patterns Factory Method Also known as: Virtual Constructor Intent Factory Method is a c.. 2021. 5. 7.
MVC vs Observer Pattern (MVC 패턴과 옵저버 패턴 차이점) MVC vs Observer Pattern (MVC 패턴과 옵저버 패턴 차이점) MVC Model: It includes all the data and its related logic View: Present data to the user or handles user interaction Controller: An interface between Model and View components View A View is that part of the application that represents the presentation of data. Views are created by the data collected from the model data. A view requests the model to g.. 2021. 5. 4.
[Proxy Pattern] 프록시 패턴이란 [Proxy Pattern] 프록시 패턴이란 1. 프록시 패턴의 정의 - Proxy is a structural design pattern that lets you provide a substitute or placeholder for another object. 프록시는 다른 개체에 대한 대체 또는 자리 표시자를 제공할 수 있는 구조 설계 패턴입니다. 프록시에게 어떤 일을 대신 시키는 것입니다. limkydev.tistory.com/79 [Design_Pattern] 프록시 패턴(Proxy Pattern) 안녕하세요. Limky 입니다. 이번 시간은 프록시 패턴(Proxy Pattern)에 대해서 알아보겠습니다. Proxy는 우리말로 대리자, 대변인 이라는 뜻입니다. 대리자, 대변인은 다른 누군가를 대.. 2021. 4. 15.
[OODP] Singleton Pattern (싱글톤 패턴)이란 [OODP] Singleton Pattern (싱글톤 패턴)이란 프로그램을 작동시키면 보통 많은 인스턴스가 생성됩니다. 예를 들면, 문자열을 나타내는 java.lang.String 클래스의 인스턴스는 문자열 1개에 대해서 1개가 생성되기 때문에 문자열이 1,000개 등장하는 프로그램이라면 1,000개의 인스턴스가 만들어집니다. 그러나 시스템 속에 1개 밖에 존재하지 않는 것을 프로그램으로 표현하고자 하는 경우에는 클래스의 인스턴스를 하나만 만듭니다. 컴퓨터 자체를 표현한 클래스, 현재의 시스템 설정을 표현한 클래스, 윈도우 시스템을 표현한 클래스 등이 예시입니다. 프로그래밍할 때 개발자가 new Class()가 한번밖에 실행되지 않도록 작성해 놓으면 Class()의 인스턴스는 1개만 생성됩니다. 이렇게 .. 2021. 4. 4.
Java Socket 메시지 주고받기 Java Socket 메시지 주고받기 예시 01 / Example 01) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 package server; import java.io.IOException; import java.io.OutputStream; import java.net.ServerSocket; import java.net.Socket; public class MainServer { public static void main(String[] args) { try { ServerSocket s_socket = new ServerSocket(8888); Socket c_socket = s_socket.accpet(); .. 2021. 4. 3.
Java Socket Test Example (1) 자바 소켓 예시 Java Socket Test Example (1) 자바 소켓 예시 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 package SocketTest; import java.io.*; import java.net.*; public class EchoClient { public static void main(String[] args) { try { String host; if (args.length > 0) { host=args[0]; } else { host = "localhost"; // host = "172.17.193.68"; } So.. 2021. 4. 3.
Java RMI (Remote Method Invocation) (3) Java RMI (Remote Method Invocation) (3) 1 2 3 4 5 6 7 8 // SampleI.java import java.rmi.Remote; import java.rmi.RemoteException; public interface SampleI extends Remote { int Add(int num1, int num2) throws RemoteException; String Echo(String Msg) throws RemoteException; } Colored by Color Scripter cs 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 .. 2021. 4. 3.

반응형