What kind of pattern has a class that contains an instance of itself cast to the interface? -


i have inherited code, , can't figure out reasoning behind architecture of 1 of classes. class looks this:

[serializable] internal class myclass : myinterface {     private dbmodel datamodel { get; set; }     private myinterface ithis { { return (myinterface)this; } }      public string someproperty { { return ithis.someproperty } }     ...     string myinterface.someproperty { { return datamodel.getsomeproperty(); } } } 

is sort of common (or uncommon) design pattern i've never seen? why want access properties way? benefit this? notice ithis not static, isn't sort of singleton pattern.

looks snapshot variant of memento, perhaps encapsulation being used @ assembly level (hence internal). can see if caretaker , originator roles filled somewhere?

snapshot pattern in plantuml


Comments

Popular posts from this blog

PHP DOM loadHTML() method unusual warning -

python - How to create jsonb index using GIN on SQLAlchemy? -

c# - TransactionScope not rolling back although no complete() is called -