My company creates Landing pages for clients. The details are sent to our system through an API. Now I am re-writing code to make it more efficient as previously it was all over the place..
Here are my two thoughts:
1. have separate files... 1 for creating XML (as they vary between landing pages), 2. another for connecting to the API and then include them
2. bundle this all up in a class? ie a function that would create the xml, another for validating, getting errors back etc..
I think i probably answered my own question, it should be 2. but wrapping API connect call in a class? is that a bit of an overkill? because that API (which has methods etc) returns errors and all the other things.. this is why 1) sounds better because all the code will be included without me calling the AP in each page?
on another note: I would like to "document" the code so the structure of the site is easier for the new person.