Map
Index
Random
Help
Topics
th

Topic: opaque and partially-opaque data types

topics > computer science > programming > object-oriented programming > Group: type inheritance



Topic:
abstract data type
Topic:
information hiding
Topic:
inheritance of properties
Topic:
interface between program modules
Topic:
localized understanding
Topic:
object-oriented data types
Topic:
object-oriented fields
Topic:
restricted and extended types
Topic:
security by access rights
Topic:
security by seal
Topic:
separate a module's interface specification from its implementation
Topic:
type reflection and introspection
Topic:
types of object-oriented classes

Summary

An opaque data type hides its fields from other classes. A partially-opaque data type reveals a few fields. Methods and fields can be marked with different protections. (cbb 4/01)
Subtopic: partially opaque type with visible fields up

Quote: the partially opaque type reveals some of an object's fields in its interface; e.g., used for I/O streams [»nelsG_1991]
Quote: a subtype declaration is opaque; a REVEAL clause introduces information about an opaque type into a scope [»cardL_1991]

Subtopic: attributes vs. instance variables up

Quote: use Ruby attributes to get and set instance variables; define explicitly or via 'attr_accessor', etc.

Subtopic: sealed classes up

Quote: use seal and unseal to control subclassing; by class or package [»corwJ10_2003]

Subtopic: pass-through module up

Quote: pass-through modules necessary for module security; e.g., hide an internal module or aggregate a collection of module interfaces [»corwJ10_2003]

Subtopic: accessibility rules up

Quote: CLR members defined with an accessibility rule: private, family, assembly, family and/or assembly, public [»hamiJ2_2003]
Quote: can not derive a subtype from a sealed CLR type
nQuote: family accessibility only allows access from derived types
Quote: assembly accessibility allows access from an assembly; i.e., one or more application units with name scoping, class versioning, etc.
Quote: a class member can be 'private', 'protected',or 'public'. Private members implement a class and protected members implement derived classes [»stroB_1991]
Quote: Ruby instance variables are always protected; accessible to subclasses only [»thomD1_2001]

Subtopic: encapsulation up

Quote: use private and protected functions whenever an object does not satisfy the class invariant [»stroB_1991]
Quote: encapsulation should guard the integrity of the protected component or its owner [»alexRT1_2000]

Subtopic: problems with accessibility up

Quote: Java protected access is an illusion; any class in the same package can modify it
[»alexRT1_2000]

Related Topics up

Topic: abstract data type (64 items)
Topic: information hiding (50 items)
Topic: inheritance of properties (24 items)
Topic: interface between program modules (55 items)
Topic: localized understanding (43 items)
Topic: object-oriented data types (29 items)
Topic: object-oriented fields (28 items)
Topic: restricted and extended types (35 items)
Topic: security by access rights (38 items)
Topic: security by seal (16 items)
Topic: separate a module's interface specification from its implementation (86 items)
Topic: type reflection and introspection (28 items)
Topic: types of object-oriented classes
(18 items)

Updated barberCB 10/04
Copyright © 2002-2008 by C. Bradford Barber. All rights reserved.
Thesa is a trademark of C. Bradford Barber.