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

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

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -