I just recently began to develop professionally. I studied OOP at a university, but I don’t feel like I have ever used it in a “real world” scenario.
In principle, trying to create / manipulate a certain type of document within the organization, I created a class for it, believing that at any time when we wanted to create / manipulate this specific type of document, we could simply create an instance of it and give it certain information and take care of yourself.
I know that we plan to work with other types of documents (I think I should note that when I say types of documents, I mean something like a "expense report" or "inventory list", as in relation to content .) I assumed that all these documents would have certain functions (for example, work with common strings or certain names in Excel), so I created an abstract class Document and thought that every type of document we wanted to create could extend this class.
Of course, I still work with only one type of document, so although I have an idea of methods that can be common to all documents, I still have only one abstract class and one that extends this, so this looks somehow unnecessary.
I think my questions are:
1) Should I use an abstract class here. How does it feel like using one correctly or have I completely missed the point?
2) If I should use it, should I not use it before? I mean, should I wait until I actually have several documents in front of me so that I can determine what functionality is shared between them, and not like what I know at the moment, although I only have one class implementing it?
Thanks.
M_R_H source share