Explain what encapsulation is and provide the elements of the three-tier structure. In your explanation of the three-tier structure, discuss how the tiers relate to one another.

What will be an ideal response?

The concept of separating processing and hiding data within specific classes is called encapsulation and is a major contributor to reliable and robust programs. When developing programs with multiple classes, a starting point for determining what classes should appear in a program is the three-tier program structure. The three-tier structure specifies that a program is divided into three separate tiers: presentation, business, and persistence. The presentation tier contains the classes that display information for the user and accept user input. In many programs, the presentation tier consists of one or more forms and the objects placed on the forms. In a Web application, the presentation tier is the Web form and Web page that appear to the user. In addition, the processing in the presentation tier ensures that valid data is entered into the program for processing in the business tier. The business tier contains the logic and calculations that must occur in order to fulfill the requirements of the program. The class(es) in the business tier generally use data entered by users and data obtained from storage to perform the logic and calculations. The business tier is so-called because the business tier implements the "business rules" required for the application. The persistence tier, sometimes called the data access tier, contains the code required to read and write data from permanent storage. Data that is stored in a file or database on disk often is called persistent data because the data remains after the program is terminated. When designing a program using the three-tier approach, a primary rule is that classes in the presentation tier can communicate only with classes in the business tier. They never can communicate with classes in the persistence tier. In the same manner, classes in the persistence tier cannot communicate with classes in the presentation tier.

Computer Science & Information Technology

You might also like to view...

A technician wants to implement a network for testing remote devices before allowing them to connect to the corporate network. Which of the following could the technician implement?

A. High availability B. MAN network C. Quarantine D. Honeynet

Computer Science & Information Technology

Excel ____ all numbers.

A. right-aligns B. left-aligns C. top-aligns D. bottom-aligns

Computer Science & Information Technology