A Formal Approach for Designing CORBA-based Applications