What are pure virtual methods in UML? -


i attempting understand how should use realization of interfaces , implementation of abstract classes in uml. came across post @ https://stackoverflow.com/a/13438187/700543 whereby poster states pure virtual methods interfaces whilst part pure virtual methods abstract classes. able give me real world scenario , not 1 based on code?

an interface "class skeleton" library users extend, , said, methods cannot implemented. abstract class can have implemented methods. give real life example:

imagine provide interface people implement sorting functions , provide class bench marking sorting functions. bench marking class needs know methods of interface needs call in order perform bench marking, not know how implemented. therefore, inside bench marking class might see sortinterfaceinstace.getnumberofswap(), whereas sortinterfaceinstance known of sortinterface type @ compile time, , not of specific user sort implementation.

if need implemented methods, use abstract instead of interfaces.


Comments

Popular posts from this blog

asp.net mvc 3 - Using mvc3, I need to add a username/password to the sql connection string at runtime -

kineticjs - draw multiple lines and delete individual line -

thumbnails - jQuery image rotate on hover -