TAILIEUCHUNG - HandBooks Professional Java-C-Scrip-SQL part 143

Tham khảo tài liệu 'handbooks professional java-c-scrip-sql part 143', 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ả | that specify classes that are nested within other classes as some of mine are. Even if this did work I d still prefer to spare the application programmer the details of these functions. Is there a solution to either or both of these problems Yes in fact both of these can be remedied. Let s start with the data problem. The standard solution to avoid exposing member variables to the application programmer is to create a secondary data structure that contains the actual data for the object and include only a pointer to such a structure in the main object. Because the compiler knows the size of a pointer to a structure without having to see the definition of the structure itself the header file that defines this secondary structure can be included only when needed in the implementation of the class. This frees the application programmer from any concern about the representation of the data. What about those functions that the application programmer doesn t need to and shouldn t call This can be solved in much the same way as the data problem. In this case however the pointer in the visible class points to an object of a class that supplies the additional functions needed by the other implementation classes. Because the client program would not include the header file that defines this secondary class it could not access those additional functions. Of course the other implementation classes would include that header file so that they could access the additional functions as needed. Why didn t I implement either of these solutions or better yet both Because doing so would have required wholesale changes to the implementation and I ran out of time. Of course had I considered these issues when I was first creating these classes they would have been fairly simple to solve but I didn t think of them at that time. In any event the design is usable as it stands even if it could be improved so let s move on to how we can use it in its present form. We ll start with the .

Đã 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.