Not all archaeology is below the ground, and standing buildings can be investigated archaeologically as well as buried sites. When looking at buildings we can apply some of the same principles, including stratigraphy - for example if we see a window frame which has been filled with bricks, we can assume that the bricks are later than the window frame.
This sort of relative dating can be very useful when we are looking at buildings, because they can tell us how buildings were changed. Buildings which have been standing for a very long time have often undergone significant changes and these may reflect changes in the use or function of the building - which in turn can tell us about the people who lived in or used it.
When looking at buildings we have to remember that their design is not just functional - many of the decisions made when designing a building may have been determined by social factors such as wealth, social standing and even fashion.