Answer the question
In order to leave comments, you need to log in
What is the best way to make a parser structure?
What is the best way to organize a service parser from an OOP point of view?
There are several sites ,
i.e. there are already several specific classes with the parse method
parserA, parserB and all implement IParser where there is a parse method that returns a certain array of data,
then you need to save this data in the database (active record is used) in the same tables (the sites are different but their data needs to be adjusted to one template (them)
How best to do this?
to make separate classes in the style of mapperA , which save the data of class A and so on?
or push the save method into IParse?
Answer the question
In order to leave comments, you need to log in
parserA, parserB and all implement IParser where there is a parse method that returns an array of data
well, these classes must return the same array of data, otherwise they don’t “implement the method”, but return a random set of who knows what.
And there already do as you like.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question