I want to develop a process (method) method takes data as a data class, and processes it . Data classes are similar, but slightly different. For example, we have the following classes of Data ProcessObject_A, ProcessAdvanced B and Process Data Object_C
Is it better to overload this method:
Zero Process (processDataObject_A Data) {// Process Data Object_A Process} Zero Process (processDataObject_B Data) {// Process Process Data Object bb} zero process (processDataObject_C data) {// process process object_here}
or some abstract data class expands in solid data classes, and passes the process method And then the method Checks and works accordingly:
Zero process (Abrix process data object data) {// Check for type here and do something}
Or is there a better way to address it? If this is a web method then what attitude will change?
Thank you in advance
I go with it:
< Pre> process (data) {data.doProcessing (); }
Comments
Post a Comment