์ผ | ์ | ํ | ์ | ๋ชฉ | ๊ธ | ํ |
---|---|---|---|---|---|---|
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 |
- ๊ธฐ๋ฅ ํ ์คํธ
- push model
- ํญํดํ๋ฌ์ค ํ๊ณ
- ๋น ์ค์ฝํ
- ํญํด ํ๊ธฐ
- ์์ฐจ์งํฅ
- ํญํดํ๋ฌ์คํ๊ธฐ
- ํญํดํ๋ฌ์ค ํ๊ธฐ
- ํญํ ํ๊ธฐ
- ํ๋กํ ํ์ ๋น
- ๋์์ธ ํจํด
- pull model
- ๋ฐ์ดํฐ ์ฟผ๋ฆฌ
- ํญํด ๋ฐฑ์๋
- ํผ๋ ๊ตฌํ
- ํญํดํ๋ฌ์ค
- ํญํด
- ์ฑ๊ธํค ๋น
- TDD
- ์์ฑ ํจํด
- ํญํดํ๋ฌ์ค๋ฐฑ์๋
- OOP
- fanout on write
- ํญํด+
- fanout on read
- ํญํ ๋ฐฑ์๋
- ํญํดํ๋ฌ์ค ๋ฐฑ์๋
- API Aggregation
- ํญํ
- ํญํด ํ๋ฌ์ค ํ๊ธฐ
- Today
- Total
deVlog
[๋์์ธ ํจํด] ์์ฑ ํจํด - Prototype Pattern (ํ๋กํ ํ์ ํจํด) ๋ณธ๋ฌธ
[๋์์ธ ํจํด] ์์ฑ ํจํด - Prototype Pattern (ํ๋กํ ํ์ ํจํด)
์๋ฃจ๋ฐ 2025. 4. 3. 23:54
๋ชฉ์ฐจ
๐ ๊ฐ์
ํ๋กํ ํ์ ํจํด(Prototype Pattern)์ ๊ธฐ์กด ๊ฐ์ฒด๋ฅผ ๋ณต์ ํ์ฌ ์๋ก์ด ๊ฐ์ฒด๋ฅผ ์์ฑํ๋ ์์ฑ ๋์์ธ ํจํด์ด๋ค. ์ฆ, ์ํ์ด ๋๋ ์ธ์คํด์ค๋ฅผ ์ฌ์ฉํด ์๋ก์ด ์ธ์คํด์ค๋ฅผ ๋ง๋๋ ๋ฐฉ์์ผ๋ก, ๊ฐ์ฒด ์์ฑ ๋น์ฉ์ด ํฐ ๊ฒฝ์ฐ์ ํจ์จ์ ์ด๋ค.
โญ๏ธ ํน์ง
- ๊ธฐ์กด ๊ฐ์ฒด์ ์ํ๋ฅผ ๊ทธ๋๋ก ๋ณต์ฌํ์ฌ ์๋ก์ด ๊ฐ์ฒด๋ฅผ ์์ฑํ๋ค.
- ๊ฐ์ฒด ์์ฑ ๊ณผ์ ์ ๋ณต์ก์ฑ์ ๊ฐ์ถ๋ค.
- ๊ฐ์ฒด ์์ฑ ๋น์ฉ์ด ํฐ ๊ฒฝ์ฐ์ ์ฑ๋ฅ์ ํฅ์์ํจ๋ค.
- ํ๋ ์์ํฌ ํ์ฅ ์ ๊ตฌ์ฒด์ ์ธ ํด๋์ค ์ ๋ณด ์์ด๋ ๊ฐ์ฒด๋ฅผ ์์ฑํ ์ ์๋ค.
๐ฉ๐ป๐ป ์ฝ๋๋ก ์์๋ณด์
ํ๋กํ ํ์ ํจํด์ ๊ตฌํํ๋ ์ฌ๋ฌ ๋ฐฉ๋ฒ์ ์ดํด๋ณด์.
1. Cloneable ์ธํฐํ์ด์ค ๊ตฌํ
// 1. Cloneable ์ธํฐํ์ด์ค๋ฅผ ๊ตฌํํ ํ๋กํ ํ์
ํด๋์ค
public class Shape implements Cloneable {
private String type;
private String color;
public Shape() {
// ๊ธฐ๋ณธ ์์ฑ์
}
public Shape(String type, String color) {
this.type = type;
this.color = color;
}
// Java์์ ์ ๊ณตํ๋ clone() ๋ฉ์๋ ์ค๋ฒ๋ผ์ด๋
@Override
public Shape clone() {
try {
// Object.clone()์ ์์ ๋ณต์ฌ(shallow copy)๋ฅผ ์ํ
return (Shape) super.clone();
} catch (CloneNotSupportedException e) {
e.printStackTrace();
return null;
}
}
// getters and setters
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getColor() {
return color;
}
public void setColor(String color) {
this.color = color;
}
@Override
public String toString() {
return "Shape [type=" + type + ", color=" + color + "]";
}
}
// ํด๋ผ์ด์ธํธ ์ฝ๋
public class PrototypeExample {
public static void main(String[] args) {
// ์๋ณธ ๊ฐ์ฒด ์์ฑ
Shape originalShape = new Shape("Circle", "Red");
System.out.println("Original: " + originalShape);
// ํ๋กํ ํ์
์ ์ด์ฉํ ๋ณต์
Shape clonedShape = originalShape.clone();
System.out.println("Cloned: " + clonedShape);
// ๋ณต์ ๋ ๊ฐ์ฒด ์์
clonedShape.setColor("Blue");
System.out.println("Modified Clone: " + clonedShape);
System.out.println("Original After Clone Modification: " + originalShape);
}
}
2. ๊น์ ๋ณต์ฌ(Deep Copy) ๊ตฌํ
// ๋ณต์กํ ๋ด๋ถ ๊ฐ์ฒด๋ฅผ ๊ฐ์ง ํ๋กํ ํ์
ํด๋์ค
public class ComplexShape implements Cloneable {
private String name;
private List<Point> points; // ๋ด๋ถ ๊ฐ์ฒด ์ฐธ์กฐ
public ComplexShape(String name) {
this.name = name;
this.points = new ArrayList<>();
}
public void addPoint(Point point) {
points.add(point);
}
// ๊น์ ๋ณต์ฌ ๊ตฌํ
@Override
public ComplexShape clone() {
try {
ComplexShape cloned = (ComplexShape) super.clone();
// ๋ด๋ถ List ๊ฐ์ฒด๋ ๋ณต์
cloned.points = new ArrayList<>();
// ๊ฐ Point ๊ฐ์ฒด๋ ๋ณต์
for (Point point : this.points) {
cloned.points.add(point.clone());
}
return cloned;
} catch (CloneNotSupportedException e) {
e.printStackTrace();
return null;
}
}
// getters and setters
@Override
public String toString() {
return "ComplexShape [name=" + name + ", points=" + points + "]";
}
}
// ๋ด๋ถ ๊ฐ์ฒด ํด๋์ค
public class Point implements Cloneable {
private int x;
private int y;
public Point(int x, int y) {
this.x = x;
this.y = y;
}
@Override
public Point clone() {
try {
return (Point) super.clone();
} catch (CloneNotSupportedException e) {
return new Point(this.x, this.y);
}
}
// getters and setters
@Override
public String toString() {
return "(" + x + "," + y + ")";
}
}
3. ์ง๋ ฌํ๋ฅผ ์ด์ฉํ ๋ณต์
import java.io.*;
public class SerializableShape implements Serializable {
private static final long serialVersionUID = 1L;
private String type;
private String color;
public SerializableShape(String type, String color) {
this.type = type;
this.color = color;
}
// ์ง๋ ฌํ๋ฅผ ํตํ ๊น์ ๋ณต์ฌ
public SerializableShape deepCopy() {
try {
// ๊ฐ์ฒด๋ฅผ ๋ฐ์ดํธ ์คํธ๋ฆผ์ผ๋ก ์ง๋ ฌํ
ByteArrayOutputStream bos = new ByteArrayOutputStream();
ObjectOutputStream oos = new ObjectOutputStream(bos);
oos.writeObject(this);
// ๋ฐ์ดํธ ์คํธ๋ฆผ์์ ๊ฐ์ฒด๋ก ์ญ์ง๋ ฌํ
ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray());
ObjectInputStream ois = new ObjectInputStream(bis);
return (SerializableShape) ois.readObject();
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
// getters and setters
@Override
public String toString() {
return "SerializableShape [type=" + type + ", color=" + color + "]";
}
}
4. ๋ณต์ ์์ฑ์/ํฉํ ๋ฆฌ ๋ฉ์๋ ์ฌ์ฉ
public class Product {
private String name;
private double price;
private List<String> features;
// ๊ธฐ๋ณธ ์์ฑ์
public Product(String name, double price) {
this.name = name;
this.price = price;
this.features = new ArrayList<>();
}
// ๋ณต์ ์์ฑ์
public Product(Product source) {
this.name = source.name;
this.price = source.price;
// ๊น์ ๋ณต์ฌ
this.features = new ArrayList<>(source.features);
}
// ์ ์ ํฉํ ๋ฆฌ ๋ฉ์๋
public static Product copyOf(Product source) {
return new Product(source);
}
public void addFeature(String feature) {
features.add(feature);
}
// getters and setters
@Override
public String toString() {
return "Product [name=" + name + ", price=" + price + ", features=" + features + "]";
}
}
// ์ฌ์ฉ ์
Product original = new Product("Smartphone", 999.99);
original.addFeature("5G");
original.addFeature("OLED Display");
// ๋ณต์ ์์ฑ์ ์ฌ์ฉ
Product clone1 = new Product(original);
// ์ ์ ํฉํ ๋ฆฌ ๋ฉ์๋ ์ฌ์ฉ
Product clone2 = Product.copyOf(original);
5. ์คํ๋ง ํ๋ ์์ํฌ์ ํ๋กํ ํ์ ๋น ์ค์ฝํ
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
@Component
@Scope("prototype")
public class PrototypeBean {
private String property;
public PrototypeBean() {
// ์ด๊ธฐํ ์์
(๋น์ฉ์ด ํฐ ์์
๊ฐ์ )
System.out.println("PrototypeBean instance created");
}
// getters and setters
}
// ์ฌ์ฉ ์ (์คํ๋ง ์ปจํ
์คํธ์์)
@Autowired
private ApplicationContext context;
public void usePrototypes() {
// ๋งค๋ฒ ์๋ก์ด ์ธ์คํด์ค ์์ฑ
PrototypeBean bean1 = context.getBean(PrototypeBean.class);
PrototypeBean bean2 = context.getBean(PrototypeBean.class);
// bean1๊ณผ bean2๋ ์๋ก ๋ค๋ฅธ ์ธ์คํด์ค
System.out.println(bean1 == bean2); // false
}
โ๏ธ ์ฅ/๋จ์
โ ์ฅ์
- ๋ณต์กํ ๊ฐ์ฒด ์์ฑ ๋น์ฉ ์ ๊ฐ
- ๊ฐ์ฒด ์์ฑ ๋น์ฉ์ด ํฐ ๊ฒฝ์ฐ ์ด๋ฏธ ์์ฑ๋ ๊ฐ์ฒด๋ฅผ ๋ณต์ ํ๋ ๊ฒ์ด ํจ์จ์ ์ด๋ค.
- ๋ฐ์ดํฐ๋ฒ ์ด์ค ์กฐํ, ๋คํธ์ํฌ ์์ฒญ, ๋ณต์กํ ๊ณ์ฐ ๋ฑ์ ํผํ ์ ์๋ค.
- ๊ตฌ์ฒด์ ์ธ ํด๋์ค์ ์์กดํ์ง ์๋ ๊ฐ์ฒด ์์ฑ
- ํด๋ผ์ด์ธํธ๊ฐ ๊ฐ์ฒด์ ๊ตฌ์ฒด์ ์ธ ํด๋์ค๋ฅผ ๋ชฐ๋ผ๋ ๊ฐ์ฒด๋ฅผ ์์ฑํ ์ ์๋ค.
- ๋คํ์ฑ์ ํ์ฉํ ์ ์ฐํ ์ค๊ณ๊ฐ ๊ฐ๋ฅํ๋ค.
- ๋ณต์กํ ์ด๊ธฐํ ์ฝ๋ ์ ๊ฑฐ
- ๊ฐ์ฒด๋ฅผ ์ฒ์๋ถํฐ ์์ฑํ๋ ๋์ ์ด๋ฏธ ์ด๊ธฐํ๋ ์ํ๋ฅผ ๋ณต์ฌํ์ฌ ์ฌ์ฉํ๋ค.
- ์ด๊ธฐํ ๋ก์ง์ ์ค๋ณตํด์ ์์ฑํ ํ์๊ฐ ์๋ค.
- ์ค์ ์ด๋ ์ํ๊ฐ ๋น์ทํ ๊ฐ์ฒด ์์ฑ
- ๊ธฐ์กด ๊ฐ์ฒด๋ฅผ ์ฝ๊ฐ๋ง ์์ ํ์ฌ ์ ์ฌํ ์ฌ๋ฌ ๊ฐ์ฒด๋ฅผ ํจ์จ์ ์ผ๋ก ์์ฑํ ์ ์๋ค.
- ๋ฐ๋ณต์ ์ธ ๊ฐ์ฒด ์์ฑ ์ฝ๋๋ฅผ ์ค์ผ ์ ์๋ค.
โ ๋จ์
- ๊น์ ๋ณต์ฌ์ ๊ตฌํ ๋ณต์ก์ฑ
- ๊ฐ์ฒด๊ฐ ์ํ ์ฐธ์กฐ๋ ๋ณต์กํ ์ฐธ์กฐ ๊ด๊ณ๋ฅผ ๊ฐ์ง ๊ฒฝ์ฐ ๊น์ ๋ณต์ฌ ๊ตฌํ์ด ์ด๋ ต๋ค.
- ํนํ ๋ณต์กํ ๊ฐ์ฒด ๊ทธ๋ํ์์ ๋ชจ๋ ๊ฐ์ฒด๋ฅผ ์ฌ๋ฐ๋ฅด๊ฒ ๋ณต์ ํ๊ธฐ ์ด๋ ต๋ค.
- ์์ฑ์ ํธ์ถ ํํผ
- ๋ณต์ ๊ณผ์ ์์ ๊ฐ์ฒด์ ์์ฑ์๊ฐ ํธ์ถ๋์ง ์์ ์ ์๋ค.
- ์ด๋ก ์ธํด ๊ฐ์ฒด ์์ฑ ๊ณผ์ ์ ์ถ์ ํ๊ฑฐ๋ ๋๋ฒ๊น ํ๊ธฐ ์ด๋ ค์ธ ์ ์๋ค.
- ๊น์ ๋ณต์ฌ์ ์์ ๋ณต์ฌ์ ์ ํ
- ์ํฉ์ ๋ฐ๋ผ ๊น์ ๋ณต์ฌ๊ฐ ํ์ํ ์ง ์์ ๋ณต์ฌ๊ฐ ์ ์ ํ ์ง ๊ฒฐ์ ํด์ผ ํ๋ค.
- ์๋ชป๋ ์ ํ์ ์์์น ๋ชปํ ๋ฒ๊ทธ๋ฅผ ๋ฐ์์ํฌ ์ ์๋ค.
- ๋ณต์ ๋์ ์ ์์ ์ด๋ ค์
- ์ผ๋ถ ๊ฐ์ฒด์ ๊ฒฝ์ฐ ์ด๋ค ์ํ๋ฅผ ๋ณต์ ํด์ผ ํ๊ณ ์ด๋ค ์ํ๋ ์ ์งํด์ผ ํ๋์ง ์ ์ํ๊ธฐ ์ด๋ ต๋ค.
- ์๋ฅผ ๋ค์ด ID๋ ํ์์คํฌํ ๊ฐ์ ๊ฐ์ ๋ณต์ ๋์ง ์์์ผ ํ ์ ์๋ค.
๐ก ์๋ฐ/์คํ๋ง ํ๋ ์์ํฌ์์์ ํ๋กํ ํ์
1. ์๋ฐ์ Cloneable ์ธํฐํ์ด์ค
Java API์์๋ Cloneable ์ธํฐํ์ด์ค์ Object.clone() ๋ฉ์๋๋ฅผ ํตํด ํ๋กํ ํ์ ํจํด์ ์ง์ํ๋ค.
public class CloneableExample implements Cloneable {
private int id;
private String name;
// ์์ ๋ณต์ฌ ๊ตฌํ
@Override
public CloneableExample clone() throws CloneNotSupportedException {
return (CloneableExample) super.clone();
}
}
2. ์คํ๋ง์ ํ๋กํ ํ์ ๋น ์ค์ฝํ
์คํ๋ง ํ๋ ์์ํฌ์์๋ ๋น ์ค์ฝํ๋ฅผ ํตํด ํ๋กํ ํ์ ํจํด์ ์ง์ํ๋ค.
import org.springframework.context.annotation.Scope;
import org.springframework.context.annotation.ScopedProxyMode;
import org.springframework.stereotype.Component;
// 1. ์ ๋
ธํ
์ด์
์ผ๋ก ํ๋กํ ํ์
์ค์ฝํ ์ง์
@Component
@Scope("prototype")
public class PrototypeComponent {
// ๋งค๋ฒ ์ ์ธ์คํด์ค ์์ฑ
}
// 2. ๋ฉ์๋ ๋ ๋ฒจ์์ ํ๋กํ ํ์
๋น ์ ์
@Configuration
public class AppConfig {
@Bean
@Scope("prototype")
public PrototypeBean prototypeBean() {
return new PrototypeBean();
}
}
// 3. XML ๊ตฌ์ฑ์ผ๋ก ํ๋กํ ํ์
๋น ์ ์
<!-- applicationContext.xml -->
<bean id="prototypeBean" class="com.example.PrototypeBean" scope="prototype"/>
3. ์คํ๋ง์ ApplicationContext์ ํ๋กํ ํ์ ๋น
@Service
public class SomeService {
private final ApplicationContext context;
@Autowired
public SomeService(ApplicationContext context) {
this.context = context;
}
public void doSomething() {
// ํ์ํ ๋๋ง๋ค ์ ์ธ์คํด์ค ํ๋
PrototypeBean bean = context.getBean(PrototypeBean.class);
bean.process();
}
}
4. ํ๋กํ ํ์ ๋น์ ์ฑ๊ธํค ๋น์ ์ฃผ์ ํ๋ ๋ฌธ์
@Service // ๊ธฐ๋ณธ์ ์ผ๋ก ์ฑ๊ธํค ์ค์ฝํ
public class SingletonService {
// ์ฃผ์: ์ด๋ ๊ฒ ์ฃผ์
ํ๋ฉด ํญ์ ๊ฐ์ ํ๋กํ ํ์
์ธ์คํด์ค ์ฌ์ฉ
@Autowired
private PrototypeBean prototypeBean; // ํ ๋ฒ๋ง ์ฃผ์
๋จ
// ํด๊ฒฐ์ฑ
: ObjectFactory ์ฌ์ฉ
@Autowired
private ObjectFactory<PrototypeBean> prototypeBeanFactory;
public void correctWay() {
// ๋งค๋ฒ ์ ์ธ์คํด์ค ํ๋
PrototypeBean bean = prototypeBeanFactory.getObject();
bean.process();
}
}
๐ ์ค์ ์ฌ์ฉ ์ฌ๋ก
- ์๋ฐ์ Object.clone()
- Java ํ์ค ๋ผ์ด๋ธ๋ฌ๋ฆฌ์์ ์ ๊ณตํ๋ ๊ธฐ๋ณธ์ ์ธ ํ๋กํ ํ์ ๋ฉ์ปค๋์ฆ
- ์: ArrayList, HashMap ๋ฑ ์ปฌ๋ ์ ๋ณต์
- ์คํ๋ง ํ๋ ์์ํฌ์ ํ๋กํ ํ์
๋น
- ์คํ๋ง์์ ๋น์ ํ๋กํ ํ์ ์ค์ฝํ๋ก ์ ์
- ์: ์ฌ์ฉ์๋ณ ์ค์ , ์์ฒญ๋ณ ๊ฐ์ฒด ์์ฑ
- ๋์์ธ ์์คํ
์ UI ์ปดํฌ๋ํธ
- ๊ธฐ๋ณธ ์ปดํฌ๋ํธ๋ฅผ ๋ณต์ ํ์ฌ ๋ค์ํ ์คํ์ผ์ ์ปดํฌ๋ํธ ์์ฑ
- ์: ๋ฒํผ, ์นด๋, ํผ ์์ ๋ฑ์ ํ ํ๋ฆฟ
- ๊ฒ์ ๊ฐ๋ฐ์ ๊ฐ์ฒด ์์ฑ
- ๊ธฐ๋ณธ ๊ฒ์ ๊ฐ์ฒด๋ฅผ ๋ณต์ ํ์ฌ ๋ค์ํ ์ธ์คํด์ค ์์ฑ
- ์: ์ ์บ๋ฆญํฐ, ์์ดํ , ์ฅ์ ๋ฌผ ๋ฑ
- ๋ฌธ์ ํ
ํ๋ฆฟ ์์คํ
- ๊ธฐ๋ณธ ๋ฌธ์๋ฅผ ๋ณต์ ํ์ฌ ์๋ก์ด ๋ฌธ์ ์์ฑ
- ์: ์๋ ํ๋ก์ธ์์ ํ ํ๋ฆฟ, ๋ณด๊ณ ์ ์์
- ์บ์ฑ ์์คํ
- ๋ฐ์ดํฐ๋ฒ ์ด์ค์์ ๊ฐ์ ธ์จ ๊ฐ์ฒด๋ฅผ ์บ์ํ๊ณ ๋ณต์ ํ์ฌ ์ฌ์ฉ
- ์: ์ฝ๊ธฐ ์ ์ฉ ๋ฐ์ดํฐ ๋ณต์
- ๋ฉํฐ์ค๋ ๋ ํ๊ฒฝ์ ์์ ํ ๊ฐ์ฒด ๋ณต์
- ๊ณต์ ๊ฐ์ฒด์ ์ค๋ ์ท์ ๋ง๋ค์ด ๊ฐ ์ค๋ ๋์์ ์์ ํ๊ฒ ์ฌ์ฉ
- ์: ๋ถ๋ณ ๊ฐ์ฒด์ ๋ณต์ ๋ณธ ์์ฑ
- ํ
์คํธ ํฝ์ค์ฒ ์์ฑ
- ํ ์คํธ์ ํ์ํ ๊ฐ์ฒด ์ํ๋ฅผ ๋ฏธ๋ฆฌ ์ค์ ํ๊ณ ๋ณต์ ํด์ ์ฌ์ฉ
- ์: JUnit ํ ์คํธ์ ๊ธฐ๋ณธ ๋ฐ์ดํฐ ์ค์
- ๋๋ฉ์ธ ๊ฐ์ฒด ์์ฑ
- ๊ธฐ๋ณธ ๋๋ฉ์ธ ๊ฐ์ฒด๋ฅผ ํ ํ๋ฆฟ์ผ๋ก ์ฌ์ฉํ์ฌ ์ ์ฌํ ๊ฐ์ฒด ์์ฑ
- ์: ์ฃผ๋ฌธ, ๊ณ ๊ฐ, ์ ํ ๋ฑ์ ๊ธฐ๋ณธ ํ ํ๋ฆฟ
- ์ค์ ๊ฐ์ฒด ๋ณต์
- ๊ธฐ๋ณธ ์ค์ ์ ๋ณต์ ํ์ฌ ์ฝ๊ฐ์ ์์ ๋ง์ผ๋ก ์๋ก์ด ์ค์ ์์ฑ
- ์: ์ ํ๋ฆฌ์ผ์ด์ ์ค์ , ์ฌ์ฉ์ ํ๋กํ
๐ ์ ๋ฆฌ
ํ๋กํ ํ์ ํจํด์ ๊ธฐ์กด ๊ฐ์ฒด๋ฅผ ๋ณต์ ํ์ฌ ์๋ก์ด ๊ฐ์ฒด๋ฅผ ์์ฑํ๋ ๋์์ธ ํจํด์ด๋ค.
์ด ํจํด์ ๊ฐ์ฒด ์์ฑ ๋น์ฉ์ด ํฐ ๊ฒฝ์ฐ ์ฑ๋ฅ์ ํฅ์์ํค๊ณ , A ๊ตฌ์ฒด์ ์ธ ํด๋์ค ์ ๋ณด ์์ด๋ ๊ฐ์ฒด๋ฅผ ์์ฑํ ์ ์๊ฒ ํด์ค๋ค. ํ์ง๋ง ๊น์ ๋ณต์ฌ ๊ตฌํ์ ๋ณต์ก์ฑ, ์์ฑ์ ํธ์ถ ํํผ, ๋ณต์ ๋์ ์ ์์ ์ด๋ ค์ ๋ฑ์ ๋จ์ ์ด ์๋ค.
โ ์ธ์ ์ฌ์ฉํ๋ฉด ์ข์๊น?
- ๊ฐ์ฒด ์์ฑ ๋น์ฉ์ด ํด ๋ (DB ์กฐํ, ๋คํธ์ํฌ ์์ฒญ, ๋ณต์กํ ๊ณ์ฐ ๋ฑ)
- ๋น์ทํ ๊ฐ์ฒด๋ฅผ ๋ค์ํ ์ํ๋ก ์์ฑํด์ผ ํ ๋
- ๋ฐํ์์ ํด๋์ค๋ฅผ ๋์ ์ผ๋ก ์ถ๊ฐํ๊ฑฐ๋ ์ ๊ฑฐํด์ผ ํ ๋
- ๊ฐ์ฒด์ ๊ตฌ์ฒด์ ์ธ ํ์ ์ ์์ง ๋ชปํ๊ฑฐ๋ ์์กดํ๊ณ ์ถ์ง ์์ ๋
- ํฉํ ๋ฆฌ ๋ฉ์๋ ํจํด์ผ๋ก๋ ๋๋ฌด ๋ง์ ์๋ธํด๋์ค๊ฐ ํ์ํ ๋
โ ์ธ์ ํผํด์ผ ํ ๊น?
- ๊ฐ์ฒด์ ๋ด๋ถ ์ํ๊ฐ ๋งค์ฐ ๋ณต์กํ๊ฑฐ๋ ์ํ ์ฐธ์กฐ๊ฐ ์์ ๋
- ๊ฐ์ฒด์ ์์ฑ ๋น์ฉ์ด ๋ฎ๊ณ ๊ฐ๋จํ ๋
- ๊ฐ์ฒด๊ฐ ๊ณต์ ์์์ด๋ ์ธ๋ถ ๋ฆฌ์์ค์ ์์กดํ ๋
- ๊ฐ์ฒด์ ๋ ๋ฆฝ์ฑ์ด ์ค์ํ ๊ฒฝ์ฐ