c# - Is this still an adapter pattern? -


I stumbled on this class and wondered if XYZAdapter might be the correct name I know how the adapter pattern works But this solution is slightly different: instead of implementing the datatable interface and mapping the appropriate method call, im is copying the values ​​and exposing this object and creating a new datatyal object. How it looks:

  class adapters {Private nodlist list; Datatyal table {receive CreateTable (); }} Adapter (node ​​list nl) {list = nl; } Personal DataTable CreateTable () {// Bring data to nodelight, create a table and return it back / need to be divided into smaller methods; D}}  

Usually I am doing it this way, but there is the DataTable Interface Enormous:

  class adapter: Datatale {Private nodelist list; Datatyal table {receive CreateTable (); }} Adapter (node ​​list nl) {list = nl; } // Here all the datatable methods are mapped to the node list.  

Thanks advance!

An adapter turns a non-synchronous interface into a compatible one. As this square changes a circular peg to make a peg, so that it fits a square slot.

Your solution is not technically an adapter pattern - it is more of a translator or converter. The important difference is that your adapter can not be replaced in a way that is expected of a frequency of data-table.


Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -