runtime-binding ] fttp parser

Note: Strategy pattern is not yet adopted here but more flexible than polymorphism.

* case: a default setAid() in super to be overridden by subclass to implement a /specialized/ formula
* case: getVpi() returns empty string in the base class (OLTUplinkPort) where there’s no “vpi” slot. In the ATM* subclasses, getVpi() returns the vpi slot.
* case: abstract isValid() declared in interface Validity.java.
* case: isSSCFIAccessible() is calculated differently for each building block class

“dynamic binding” is also known as dynamic dispatch. Compiler doesn’t know which version of the method to “bind the name to”. Only at runtime can the jvm put its finger on the most specialized subclass implementation.

In a circuit we have a list of CircuitElements objects, sitting on various levels of the inheritance hierarchy. We invoke isValid() on each. Some will run the isValid() inherited from a parent class, some will run the grand-parent’s implementation, but jvm ensures the most *specific* implementation in each case is chosen to run.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s