Any program that uses library linkages is part of a distributed application. To get the most out of using libraries, it is essential that such applications are designed with this distributed nature in mind. Almost all architectures used to create distributed applications follow one of the two following models.
Two-Tier Model
The two-tier model is the more traditional approach to application distribution. Two-Tier Model illustrates the two-tier model.
Three-Tier Model
The three-tier model is the newer approach to application distribution. Three-Tier Model illustrates the three-tier model.
The three-tier model is more complex than the two-tier model, but it is also more flexible and robust. There are many ways the models can be mapped to application architectures. In simple cases, one program can contain the whole model. In the more complex cases, each tier is represented by a separate program and the application uses different services so a program is part of several distribution models. Libraries can be used as the interaction mechanism, but they are not the only interaction mechanism in situations where programs interact. In designing such a system, it is important to recognize which role each side of a library linkage has to fulfill, and what the implementation choices are. An implementation should avoid combining these roles whenever possible. If a library implements two services, there should be separate interfaces to each of the services.



