phức tạp hơn một ứng dụng là sự phức tạp của các lớp và các đối tượng sử dụng tăng lên. Đối tượng phức tạp được thực hiện của các bộ phận sản xuất bởi các đối tượng khác cần được chăm sóc đặc biệt khi được xây dựng. Một ứng dụng có thể cần một cơ chế để xây dựng đối tượng phức tạp, độc lập với những người mà tạo nên các đối tượng. Nếu đây là vấn đề bạn đang phải đối mặt với, bạn có thể muốn thử sử dụng Builder (hoặc Builder thích ứng) mẫu thiết kế.
Mô hình này cho phép một đối tượng khách hàng để xây dựng một đối tượng phức tạp bằng cách xác định chỉ loại và nội dung của nó, được che chắn từ chi tiết liên quan đến các đại diện đối tượng. Bằng cách này, quá trình xây dựng có thể được sử dụng để tạo ra các đại diện khác nhau. Logic của quá trình này được phân lập dưới dạng các bước thực tế được sử dụng trong việc tạo ra các đối tượng phức tạp, vì vậy quá trình này có thể được sử dụng lại để tạo ra một đối tượng khác nhau hình thành cùng một tập các đối tượng đơn giản như một trong những đầu tiên.
đang được dịch, vui lòng đợi..