about:navigating_principle_languages
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
about:navigating_principle_languages [2013-09-13 16:09] – christian | about:navigating_principle_languages [2013-09-14 15:55] – code DataImpl christian | ||
---|---|---|---|
Line 43: | Line 43: | ||
* For the data layer there is a data component, a class '' | * For the data layer there is a data component, a class '' | ||
- | FIXME code for Data class | + | <code java> |
+ | public | ||
+ | { | ||
+ | public EnterpriseQueryIf getEnterpriseQueryIf() | ||
+ | { | ||
+ | return new EnterpriseQueryImpl(); | ||
+ | } | ||
+ | |||
+ | public PersistenceIf getPersistenceManager() | ||
+ | { | ||
+ | return new PersistenceImpl(); | ||
+ | } | ||
+ | |||
+ | public StoreQueryIf getStoreQueryIf() | ||
+ | { | ||
+ | return new StoreQueryImpl(); | ||
+ | } | ||
+ | } | ||
+ | </ | ||
* There are " | * There are " | ||
Line 53: | Line 71: | ||
private static DataIf dataaccess = null; | private static DataIf dataaccess = null; | ||
- | private DataIfFactory () {} | + | private DataIfFactory() {} |
- | public static DataIf getInstance () | + | public static DataIf getInstance() |
{ | { | ||
if (dataaccess == null) | if (dataaccess == null) | ||
{ | { | ||
- | dataaccess = new DataImpl (); | + | dataaccess = new DataImpl(); |
} | } | ||
return dataaccess; | return dataaccess; | ||
Line 127: | Line 145: | ||
As a result we get {LC, KISS, RoE, TdA/IE, ML} as the characterizing set. | As a result we get {LC, KISS, RoE, TdA/IE, ML} as the characterizing set. | ||
- | Note that although in this example the principles are examined in a certain order. Nevertheless | + | Note that although in this example the principles are examined in a certain order, the method does not prescribe any. |
==== Using the Characterizing Set ==== | ==== Using the Characterizing Set ==== | ||
+ | |||
+ | In order to answer the above question, we have to informally rate the solution based on the principles of the characterizing set: | ||
* LC | * LC | ||
+ | * The solution creates a relatively strong coupling to the concrete implementations of the components. If a class uses the " | ||
* KISS | * KISS | ||
+ | * The solution is pretty easy to implement. Furthermore it is easy to get access to an arbitrary component. So according to KISS this is a good solution. | ||
* RoE | * RoE | ||
+ | * Getting access to a component is implicit. There is no need to explicitly pass a reference around. There is not even the necessity to explicitly define an attribute for the dependent class. RoE tells, that the solution is bad. | ||
* TdA/IE | * TdA/IE | ||
+ | * Getting access to a the '' | ||
* ML | * ML | ||
+ | * There are no particular pitfalls with this solution. So ML has nothing against it. | ||
+ | |||
+ | So LC, RoE and TdA/IE are against the solution, KISS thinks it's good and ML has nothing against it. As it is not the number of principles which is important, the designer still has to make a sound judgment based on these results. What is more important: Coupling, testability, |
about/navigating_principle_languages.txt · Last modified: 2013-09-16 17:27 by christian