c# - Using related functions in one class -


i have class 2 related functions (methods):

public class class1 {     public void subscribetolistofevents()     {         // ....     }      public void unsubscribefromlistofevents()     {         // ....     } } 

what's best practice use related functions in 1 class ?

do know of implementations of related functions 1 function ? ? in situations ? if so, can hyou give me example?

any available options of code above appreciated.

if functions belong class, logically, fine way.

a class should cohesive , methods operation should have mirror operation defined (subscribe/unsubscribe, add/remove etc...).

you have named them well, descriptive of - how name merged one? better leave them separate, way self documenting , not confuse users of class.


Comments

Popular posts from this blog

windows - Why does Vista not allow creation of shortcuts to "Programs" on a NonAdmin account? Not supposed to install apps from NonAdmin account? -

c++ - How do I get a multi line tooltip in MFC -

unit testing - How to mock PreferenceManager in Android? -