I understand that there are a few questions on OOD; this is not a duplicate (I hope) because of its specific nature - can functionality that processes data be a class?
Firstly, some background.
This was due to a discussion of my leader with me. I had to write a video upload class. His idea was to upload one class of video.
I thought about it and came up with the Video class, which stores the codec, file name, frame per second and, more importantly, byte arrays, and the VideoLoader class, which takes the file name, a link to the Video class, and then populates it.
My supervisor said this is not true. "The class should always have a state." I guess he meant private members here. "VideoLoader is just a bunch of processing functions. It doesn't have to be a class." I affirm that I am doing a denouement. VideoLoader may have an abstract base class in the future if we use different libraries (currently FFMPEG) to load videos.
I agree with your approach.
VideoLoader , , , . . , - -.
, Load Video .
public class Video { private Video () { } public Video Load (/* Parameters */) { Video video = new Video (); // Set up this video object return video; } }
, Factory pattern.
: Factory . , . factory ( ).
, "er", Loader, Runner, Writer .. , , , . , "Echoer". , , .
, , , , - . , , , , , , - .
, - , . , - OO- , (, ) , , .
, ( ), Strategy. - , , .
, . - . , , , .
, , factory ( ) flyweight. , , , . VideoLoader . , , -, ( Factory).
, , , - , , ""? , , .
- , RPG. , , . , . . , . , , . , ; , .
The video processor may have a state.
Source: https://habr.com/ru/post/1714593/More articles:jQuery Sort and Stop MVC - jqueryHow to avoid page break before starting a bibliography? - latexIs Canvas hardware accelerated on Android being drawn? - androidHow to sort an array from a file (PHP)? - phpXML validation in Python without dependencies other than python - pythoncan't edit line at python command line on Linux - pythonhttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1714595/bash-operator-in-is-too-smart&usg=ALkJrhg-qb4z30Y31d4LB1Vcgur0RU4A6QFinding the side length of the cross section of a truncated cone / truncated pyramid pyramid - mathflex3 menubar: bindings on included properties - flexПолучение дней рождения друзей из профиля facebook - facebookAll Articles