Question

Should a Presentation Layer be split into presenting and receiving objects Or single objects that handle data in both directions?

Was it helpful?

Solution

The presentation layer should be sitting behind interfaces that handle both presenting and receiving. The main reason is that if you had two interfaces, one for presenting and the other receiving it is possible, in theory to wind up with two different object assigned to each causing strangeness in testing.

However if your interface is developing into dozens of method you may want to step back and look at dividing it into smaller units then aggregate them. Not necessarily based on receiving and presenting but more logical divisions of your presentation UI.

For example you could have a IPresentationUI with two variables one is an interface of IPresentationDisplay and the other of IPresentationControl. The only registration routine you have will accept a IPresentationUI object. The class implementing the Prensentation layer would be implementing three interfaces IPresentationUI, IPresentationControl, and IPresentationDisplay.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top