Interactions among two or more components may consist of passing of (large) data, a continuation, or a remote method call. Optimizing or minimizing the cost of such interactions is a fundamental problem in generating efficient code for component-oriented programs. This paper lays out a foundation for modeling and optimizing the interaction between components, with the goal of optimizing the entire assembled system. Our approach consists of automatically choosing, among a number of potential candidate, implementation strategies for choice of data structures, communication mechanisms, data placement, etc., components may use during their life time. By building a high-level optimizer that has dynamic knowledge of how components will be used in a system, we may achieve performance improvements of an order of magnitude or more. In our approach, a component writer provides the alternative implementation strategies, and our analysis will recommend or use the best strategies among the alternative during execution. One way to specify different alternatives is to recognize the characterization of problem domain. A more efficient code may be generated if we recognize the dynamic nature of the component usage. For instance, at one point during execution a component may choose one alternative strategy that is different from the choice it makes at another program point. In general, information needed to decide when to use one implementation over another may not be available to a component writer, but it is available when components are put to use in a system (for instance, the knowledge about objects are allocated, say for locality analysis, is only available at runtime). Sometimes choosing among the alternative implementations can especially tricky because the different choices are not independent of each other. This means an implementation choice that works well for one component may hurt the performance of another, This problem is particularly troublesome for component writers, since they have an extremely clear view of one component but cannot see the rest. For example, programs which work on the net will generally do better with ASCII strings, whereas programs that work heavily with databases might do better with EBCDIC -- and programs which do both (or systems in which the two kinds of program coexist) have to choose between them, or pay the cost of translation. Similarly, distributed objects that interact extensively should be on the same machine, although it does not matter on which machine they reside. Many of these optimizations can be reduced to a graph-cutting problem in which nodes in the graph correspond to objects and edges and its weights correspond to their interact. To optimize the interaction, we need to find a min-cut on the graph, and in general the min-cut problem is NP hard. We give heuristics that often give an almost linear time performance on actual instances of the problem. We present a vision for how future high-level optimizations that can optimize programs as they are written today, eliminating some of the inefficiencies caused by the high level component based programming. In the full paper we present theoretical analysis and case studies that show the feasibility of this approach, however much research remains to be done to achieve the promise.