#Abstraction

1 messages · Page 1 of 1 (latest)

zealous merlin
#

In my program (Media database with postgres) I have these classes. Im going to make a Gif class and GifDAO class

These classes all enter the same table in the database (files)

And they only differ by one field in Video and Image Media , and only one method in the DAOs insertMEDIA

My current ideas:

A: Extract a MediaProperties class and inject in the Image and Video constructors

B: Have a File abstract class, and Video and Image extend it.

For the DAO, I thought of a Inserter interface with an insert method, but these DAO would also do other operations, so maybe an Accessor Interface.

Other questions:

Is it a good time to abstract right now? Or should I make the Gif class and wait then, or make more methods (DeleteImage, UpdateVideo), or do a different thing like add the file system to parse Images and Videos for their properties to insert into the database? catwut

steep basinBOT
#

<@&987246584574140416> please have a look, thanks.

steep basinBOT
rare brook
#

I'd go with an immutable MediaProperties record