Designing Multi-Layers Self-Adaptive Complex Applications