{"id":265,"date":"2019-11-01T13:59:20","date_gmt":"2019-11-01T13:59:20","guid":{"rendered":"https:\/\/sdf-docs.mansystems.com\/docs\/acr-rules\/architecture\/inheritance-depth\/"},"modified":"2020-10-14T06:44:42","modified_gmt":"2020-10-14T06:44:42","slug":"multilevelinheritance","status":"publish","type":"docs","link":"https:\/\/sdf-docs.clevr.com\/?docs=acr-rules\/architecture\/multilevelinheritance","title":{"rendered":"Inheritance should be limited to 2 levels"},"content":{"rendered":"\n<table class=\"wp-block-table\"><tbody><tr><td>\n  Checks if there are too many levels of\n  inheritance present\n  <\/td><\/tr><tr><td>\n  Using inheritance is an architectural consideration,\n  but it can really affect performance. Mendix creates an extra table per\n  inherited entity. So querying on&nbsp; an\n  entity with inheritance takes a lot of extra joining. Also when applying\n  xpath access the row check needs to be applied per type, so many OR-ed\n  clauses are added.\n  <em>A well known example to Mansystems is\n  a query that as MxAdmin (without xpath access) is half a page A4 and as a\n  User with xpath access is 30 pages A4! Obviously the query took from 2\n  seconds to 1 minute on a medium to large database. An obviously this app has\n  been redesigned in the mean time. <\/em>&nbsp;\n  <\/td><\/tr><tr><td>\n  Add a integer that constrains the max\n  depth of inheritance.\n  <\/td><\/tr><\/tbody><\/table>\n","protected":false},"featured_media":0,"parent":99,"menu_order":8,"comment_status":"open","ping_status":"closed","template":"","doc_tag":[],"class_list":["post-265","docs","type-docs","status-publish","hentry"],"comment_count":0,"_links":{"self":[{"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs\/265"}],"collection":[{"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/types\/docs"}],"replies":[{"embeddable":true,"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=265"}],"version-history":[{"count":2,"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs\/265\/revisions"}],"predecessor-version":[{"id":858,"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs\/265\/revisions\/858"}],"up":[{"embeddable":true,"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs\/99"}],"next":[{"title":"Microflow should be simple (cyclomatic complexity)","link":"https:\/\/sdf-docs.clevr.com\/?docs=acr-rules\/architecture\/cyclomaticcomplexity","href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs\/600"}],"prev":[{"title":"Entities should not inherit from a system entity","link":"https:\/\/sdf-docs.clevr.com\/?docs=acr-rules\/architecture\/inheritfromsystem","href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs\/620"}],"wp:attachment":[{"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=265"}],"wp:term":[{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=%2Fwp%2Fv2%2Fdoc_tag&post=265"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}