Dynamic polymorphism refers to an entity changing its form depending on the circumstances.View more random threads:
- MGT111 GDB NO-01 Discussion and Solution Fall 2014 November...
- hrm627 GDB idea solution 27 May 2011
- Mgt603 GDB No. 1 Solution fall 2010
- MGT111 GDB solution fall 2010
- MGT502 Organizational Behaviour GDB no 2 fall 13 January...
- First gdb of STA630 Research Methods Fall 23 October 2012
- MGT501 Human Resource Management GDB No.1 Discussions and...
- MCM311 GDB Spring 2011 idea Solution
- PSY502 History & Systems of Psychology GDB Solution Fall...
- MGT520 International Business GDB No. 01 Solution and...
A function is said to exhibit dynamic polymorphism when it exists in more than one form, and calls to its various forms are resolved dynamically when the program is executed.
The term late binding refers to the resolution of the functions at run-time instead of compile time. This feature increases the flexibility of the program by allowing the appropriate method to be invoked, depending on the context.
Static polymorphism is considered more efficient and dynamic polymorphism more flexible.
Statically bound methods are those methods that are bound to their calls at compile time. Dynamic function calls are bound to the functions during run-time. This involves the additional step of searching the functions during run-time. On the other hand, no run-time search is required for statically bound functions.
As applications are becoming larger and more complicated, the need for flexibility is increasing rapidly. Most users have to periodically upgrade their software, and this could become a very tedious task if static polymorphism is applied. This is because any change in requirements requires a major modification in the code. In the case of dynamic binding, the function calls are resolved at run-time, thereby giving the user the flexibility to alter the call without having to modify the code.
To the programmer, efficiency and performance would probably be a primary concern, but to the user, flexibility or maintainability may be much more important.
The decision is thus a trade-off between efficiency and flexibility.
Sponsored Links