2009 visibility

2009 visibility - Fall 2009 AXS-3913 Ron McFadyen...

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Fall 2009 AXS-3913 Ron McFadyen Visibility Visibility: the ability of one object to see or have a reference to another object. e.g. When a register object sends a message to a sale object, the register must have visibility to the sale. enterItem() :Register :Sale 2:makeLineItem() Register has to know about sale in order to send this message. The sale must be visible to the register. Fall 2009 AXS-3913 Ron McFadyen Visibility from Register to Product Catalogue is required due to the collaboration diagram Visibility : Register enterItem (itemID, quantity) : ProductCatalog spec := getProductDesc( itemID ) { public void enterItem( itemID, qty ) { ... spec = catalog. getProductDesc(itemID) ... } } class Register { ... private ProductCatalog catalog; ... } Fall 2009 AXS-3913 Ron McFadyen Visibility Visibility from A to B can occur in four ways: • Attribute B is an attribute of A • Parameter B is a parameter of a method of A • Local B is a non-parameter local object in a method of A • Global B is globally visible Fall 2009 AXS-3913 Ron McFadyen Attribute Visibility Register has an attribute that holds the reference to the catalog, and so register has attribute visibility to the Product Catalog. This is very common....
View Full Document

Page1 / 10

2009 visibility - Fall 2009 AXS-3913 Ron McFadyen...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online