Global enterprise systems, E-commerce and E-service systems are both critical for businesses and very complex and expensive to build up and run. Their design and upgrading requires an advanced technology of system integration and management that guarantees satisfaction of various requirements such as cost/performance, high availability, recoverability, security, etc. This paper advocates a systematic, quantitative approach to the analysis and optimization of the architecture of such very large distributed systems that we call Systems of Systems (SoS). This approach is based on a uniform representation of SoS as hierarchical communicating structures built from a small number of simple notions with the help of simple compositional rules. Such a representation forms a common basis for various system analysis techniques and tools that may be integrated into a system design and management environment called System Factory. Its objective is significantly reduce time, cost and risk of the SoS deployment and running. The functionality and structure of a System Factory is described in the paper, as well as some examples of application of the described approach to the modeling of enterprise systems.