Comparison among Mosque, School and Caravansary and differences of Yards
Mosque must be overlooking to Kiblah and dome of the house should be built on the same front. That's why in Iranian mosques special attention is done to Eyvan in that front.
If we consider "yard" as a common aspects of architecture in Iran, four-veranda-yard of mosque is a perfect example of an ideal yard. That yard in schools and caravanserais is double-feature of the same four-veranda-yard, but on the contrary to mosque, on these two samples overlooking to Kiblah is not a must (in mosque-school, also yard is built toward Kiblah) and house dome doesn't stand in main veranda.
One of the specialties of mosques and public places is that they must be pair, i.e., symmetry must be kept to attract glance to the center of construction, which is the most important part of building. This point was also considered in school and caravansary. Yard lays the symmetric facades side by side.
In architecture of school and caravansary, value of all fronts are almost equal, considering application of those two buildings, as short-term residences. Their common aspects, from point of view of location of various elements of architecture and various application, is multifarious.
In square-shaped plans of school and caravanserais, there is a basic difference between lateral places of yard and cornered places. This difference could be found, because repeating lateral rooms in building is rather stable and similar, while rooms in corners and on ribs are quite different.
In architecture of school and caravansary, in fact the most stable part of building, constructed around yard, are residential room and chambers, repeated without basic alternation. Entrances and corners, in which the less important spaces are set, are from variant elements around yard.
With due regards to the fact that architecture of yarded buildings is a combination of layers or rings around central yard and that each layer embraces a part of rooms, verandas, storages, ..., by alternation, increasing or decreasing layers, one could distinguish types of building.
Architecture of caravansary has an outer layer as stables and storages, but no such a layer in school. In architecture of school, it is only added to entrance section or one of the fronts of layer; usually, there's no need for an extra layer on the other fronts of yard.