From f0c7185862a4e575967763b47519f8aa2feb1342 Mon Sep 17 00:00:00 2001 From: Tony Date: Tue, 24 Sep 2019 09:01:21 -0500 Subject: [PATCH] style guide updates --- src/pages/quick-reference/pages/style-guide.adoc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/pages/quick-reference/pages/style-guide.adoc b/src/pages/quick-reference/pages/style-guide.adoc index 84cb2ec..e034bc3 100644 --- a/src/pages/quick-reference/pages/style-guide.adoc +++ b/src/pages/quick-reference/pages/style-guide.adoc @@ -160,11 +160,21 @@ private String notificationPreference; private String notificationPreference; ---- +=== Domain Entity Definitions + +*Do* write simple encapsulated Java objects as view/core domain entity definitions. + +*Avoid* writing business logic inside view/core domains. + +*Avoid* writing custom getter/setter methods with logic in view/core domains. + +*Why?* View and core domains are mean to be POJO's (plain old Java objects) having simple getter/setter methods with the purpose of passing clean and concise data to/from the system. Adding business logic within POJO's can often increase code complexity and cause unexpected/hard-to-find behavior in other layers of an application. + == Testing === Response Parsing -Avoid searching for outputs in the server response (`MultiOutput`) by using an index. +*Avoid* searching for outputs in the server response (`MultiOutput`) by using an index. *Why?* The order of outputs is not guaranteed to always stay the same. Hard-coding index values may lead to brittle test cases.