© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•10mo ago•
14 replies
justroland

✅ Abstract Class vs Interface

I am building a WPF financial application from some VBA code I'm rewriting in C#, someone else wrote the VBA and so far I've managed to translate 40% of the functionality.

I have the following structure:
public class I03 -> reads + filters out invalid financial transactions from a text file
interface ILineItem -> defines properties for the following classes:
public class HeaderData
public class LineItem

HeaderData and LineItem will be used in a factory design pattern, as each valid transactional data should be an instance of either of the two classes.
My question is, should I have used an abstract class to derive HeaderData and LineItem from?
I initially wrote the classes like this to make unit tests for each property but now I've gotten to the part where I have to think deeper about how the code will be implemented.

When should we use Interfaces and when should we use an abstract class? In the latest .net sdk it seems like interfaces became more like an abstract class and I don't see the big difference, what am I missing?
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

❔ abstract class vs interface
C#CC# / help
3y ago
ELI5 : Abstract Class vs Interface
C#CC# / help
2y ago
❔ abstract class virtual methods vs default implementation interface
C#CC# / help
4y ago
Abstract class functions
C#CC# / help
4y ago