Building Java Enterprise Applications Volume I: Architecture phần 2

Tham khảo tài liệu 'building java enterprise applications volume i: architecture phần 2', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | Building Java Enterprise Applications Volume I Architecture The code that creates users will need to specifically check for and handle this error condition. This is something I ll explain later. At the same time usernames may need to be at least four characters long for example . This is another similar constraint but must be handled completely differently. First the mechanism for length checking is not as standardized as the check for uniqueness. Some databases allow a data length both minimum and maximum to be directly defined. Other databases provide for triggers to be coded that perform these checks and generate errors if needed. And still other databases provide no means for this sort of check at all. In these cases where generic means are either nonexistent or insufficient the answer is to code code code. So the answer to where data constraints belong is a mixed message. In almost all cases if a constraint is set on data it should be at least checked for specifically if not completely handled at the application level. And in the cases where a database offers a general way preferably across databases to enforce constraints at a lower level those means should be used in addition to application code. User types Another requirement of the Forethought application is the ability to represent both clients and employees in a similar fashion. While there is certainly a temptation to store these users in two separate areas of the data store you should not give in the information being stored about employees and clients is exactly the same username first name and last name . In fact there is rarely a time when the core information about disparate groups of people is significantly different. The only difference here is that an employee has an associated office record but simply adding a separate structure for office data takes care of that requirement and still allows the use of a single structure for both clients and employees. Records Structures and Other .

Không thể tạo bản xem trước, hãy bấm tải xuống
TÀI LIỆU MỚI ĐĂNG
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.