What classes to put exactly in a class diagram?

What classes must I put in a class diagram? Only classes used in Business Layer and associations between them? Or also other classes in the Data Access Layer, Service Layer, etc.?

1

Exactly those classes which are necessary to understand the aspect of the system which that particular class diagram depicts.

It could be the entire domain model, or all classes that make up the external API of a particular layer or subsystem, or whatever you think is important.

But note that class diagrams are not the only type of diagram, nor the most useful one.

3

First of all, you are not limited to one class diagram. You can have as many diagrams as you want! the purpose of the class diagrams is to help you (or someone else) understand the system better, so it is mostly a problem of taste. Some people need to see all of the details to understand the structure of the system and so they need one big class diagram. But other people prefer having the big picture separated into smaller chunks where each one shows only a part of the system, and they can build their own “big picture” in the head.

BTW, you can also create a component diagram that connects the small details of the class diagrams into a more high-level diagram.

You should include all classes in your program, as a class diagram is suppose to describe the entire structure of your program/application.

However, in many applications this process could turn quite complex, so try to isolate the main components (Data Access Layer, Service Layer, Business Layer, etc.) and graph them independently, with proper documentation as to how they interact with each other.

For the class diagram to be useful, you need to divided it by layers, and by components within these layers, if necessary. If it is still too complex, it means you might need to rethink the relationships among your classes. Mapping them all out can help you understand which ones are needed, which ones can be combined, or which deleted, and improve it to the point you have a simpler class diagram, thus a simpler program structure.

8

I try to include every class, but sometimes during implementation I may find that a class is rather big, so I split it into small helper classes. I typically don’t bother putting them into the class diagram because it would offer little value. They are not design artifacts.

But start off by including everything in your diagram.

A class diagram represents an individual component of a system, or the system as a whole. At the highest level you have a System context diagram which shows the individual components of a system.

Class diagrams could represent all classes in a small project however you would be far better placed to have multiple diagrams representing each component in your project.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật