= Interface layers = Interface layers and additional relations can define and can check wether in this architecture there are function calls, that insult the layer hierarchy or not. == Define interface layers == We can define the hierarchy of the interface layers with a list. The first element of the list is at the bottom of the layer hierarchy and the last element of the list is at the top of it. This means, that '''by default every layer can call functions from its own layer and the layer immediately below'''. The list contains tuples. Every tuple defines an interface layer: the first element of the tuple is a label with the name of the label; the second element is a list, that contains the modules, which from the layer is built. There are four ways to specify this list with: * name of the modules: {{{[{il1,[one1,one2]},{il2,[two1]}]}}}, * module nodes: {{{[{il1,[{'gn',module,2},{'gn',module,4}]},{il2,[{'gn',module,6}]}]}}}, * list of regexps: {{{[{il1,["^(/home/user)/[a-zA-Z0-9_/]+(/layer1)$"]},{il2,["(/layer2)$","^(/home/user/layer2/src)$"]}]}}}, * file, that contain regexps: {{{[{il1,["layer1"]}, {il2,["layer2"]}]}}}. In this example ''layer1'' and ''layer2'' are files, which contain regexps. We can mix the ways of specifications. == Define additional relations == Between two layers we can defne a relation, which allows function calls from the first to the second layer. The definition of these additional relations available with a list, that contains this pairs in tuples. We can refer to interface layers with their names. Suppose, that we want to allow function calls from ''il1'' to ''il2'' as well as from ''il2'' to ''il4'' layer: {{{[{il1,il2},{il2,il4}]}}}. == Examples == {{{ ri:check_layered_arch([ {il1,["^(/home/user/layers/layer1)$"]}, {il2,["^(/home/user/layers/layer2)$"]}, {il3,["regexp3"]}],[]). ri:show_layered_arch([ {il1,["^(/home/user/layers/layer1)$"]}, {il2,["^(/home/user/layers/layer2)$"]}, {il3,["regexp3"]}],[]). ri:show_layered_arch([ {il1,["^(/home/user/layers/layer1)$"]}, {il2,["^(/home/user/layers/layer2)$"]}, {il3,["regexp3"]}], [{il1,il3}]). }}}