# When to Associate View Objects with Entity Objects

Generally, you want View Objects associated to Entity Objects. This allows the rowsets to support updates, inserts, deletes with automatic triggering of business logic in the underlying, related Entity Objects. Updates made through any View Object in your session automatically show up in other View Objects displaying the same logical Entity Object attributes. This behavior is only possible when the View Object and Entity Object are related.

An exception to this rule occurs if your view only queries data and never inserts, updates, or deletes. In this case, your View Object should not be related to Entity Objects since this may not add useful functionality.

Under certain circumstances you can use ForwardOnly mode for your View Object to save memory and time by not caching any row data (`vo.setForwardOnly(true)`);. For example, use ForwardOnly mode:

- When you do not need to scroll the results.

- When you do not iterate the results multiple times.

- When you do not refer to them again in the same session (for example, when you simply print out the rows to a web page).

However, it is important to associate your View Object to an Entity Object:

- When you want your View Object to be notified that another updateable View Object has modified the same data.

- When you need to scroll and cache the read-only result.

- When the query is a join query.

  When you will be joining tables that will result in much repeated data in each row (for example joining EMP/DEPT where 100 rows in the join all come from Department 10). In this case, associating your View Object to an Entity Object will save significant memory since Business Components for Java will only cache one Entity Object row for Department 10 once. The 100 EMPs will reference the information for Department 10.