Pattern: Narrow Views



To apply NarrowViews means accessing only those fields in a database that are really needed for a use case.


For an order processing system you want to design a dialog box to select orders by customer and to view them. You have already defined a Physical View for orders and as you have use cases that process more than one order at a time, you have implemented a readMultiple() method that delivers a set of orders for a given customer.



What kind of views should you use for filling list boxes?



Use narrow views. Views for list boxes should contain the data needed in the list box and the primary key to access the object that you intend to select from the list box.


Related Patterns

For reasons of clarity we have factored out the second rule for list boxes in the ShortViews pattern.