This paper contributes to the runtime cross-cutting concerns problem by a layer structure model based on UML (Unified-Modeling Language) and code generation to COP (Context-Oriented Programming). For software development, the cross-cutting concerns problem is well-known to cause complicated models. The reason is that one cross-cutting concern affects multiple objects. Also, the problems occasionally occur at runtime. Recently, this problem has become more challenging. Modern software such as IoTs usually connect with many machines and devices and change context-dependent behavior at runtime. Thus, runtime crosscutting problems will occur increasingly. To solve this problem, we focus on the COP. It can gather scattered cross-cutting concerns in one module called the layer and change the layer at runtime. However, UML lacks the notation involving COP and also the code generation. Therefore, the first step to solve the runtime crosscutting concerns problem is to propose a layer structure model on UML and COP code generation from its model.