If you were living in a medieval town and you were rich, chances are, you were living in a tower. The tower was your personal fortress, and it was, where your personal soldiers defended your fortunes. Of course this is a very late specimen, but military architecture is, what this is based upon.