Skip to main content
added 386 characters in body
Source Link
Force444
  • 643
  • 2
  • 7
  • 13

What's the name for a class that has only methods? There are no fields/properties. Just two methods with the ability to parse some file in two ways. I have named the class Parser, but it just doesn't seem right to have a class do only that. Or?

Should it be in a class ?

EDIT:

Dummy Example

class Parser
{
     public int parseMethod1(string file)
     {
         //parse & return
     }

     public string[] parseMethod2(string file)
     {
         //parse & return
     }
}

How could I write an interface IParser which allowed me to have a subclass only implement one of the methods?

What's the name for a class that has only methods? There are no fields/properties. Just two methods with the ability to parse some file in two ways. I have named the class Parser, but it just doesn't seem right to have a class do only that. Or?

Should it be in a class ?

What's the name for a class that has only methods? There are no fields/properties. Just two methods with the ability to parse some file in two ways. I have named the class Parser, but it just doesn't seem right to have a class do only that. Or?

Should it be in a class ?

EDIT:

Dummy Example

class Parser
{
     public int parseMethod1(string file)
     {
         //parse & return
     }

     public string[] parseMethod2(string file)
     {
         //parse & return
     }
}

How could I write an interface IParser which allowed me to have a subclass only implement one of the methods?

Post Undeleted by Force444
Post Deleted by Force444
Source Link
Force444
  • 643
  • 2
  • 7
  • 13

A class with only methods

What's the name for a class that has only methods? There are no fields/properties. Just two methods with the ability to parse some file in two ways. I have named the class Parser, but it just doesn't seem right to have a class do only that. Or?

Should it be in a class ?