I have two years worth of PHP experience however I have never worked with design patterns. I have recently been given a task at work that has made me question the wisdom of that decision.
I have been asked to create a system that:
Insert orders into a database. These orders can have a multitude of attributes and control logic that needs to be applied. The system will not be directly responsible for a front end, it will receive commands via an API.
Write the scripts that extracts orders from the database, decide which supplier to send with and create the associated files for uploading to a provider. File formates vary (XML, CSV).
Process incoming files from suppliers in the various formates (XML, CVS) and update the databases. Also FTP will have to be utilised to gather the files from the remote host.
I would like a central control class that can service each of the required functions, one point of access so to speak. This would then extend into the various specific functionality as required.
I am wondering if it is worth learning a design pattern to facilitate this system, if so could someone point me in a direction as there are many. Any advise on my issue would be very helpful.
Thanks in advance
Keep in mind that a design pattern won't solve your problem, rather it's a reusable abstract method of a solving a problem (or given set of problems.)
Based on your description and idea, it sounds like you already have a grasp of the situation and how you would like to handle it.
I'm not one to get caught up in design patterns too much, I'd probably just run with what you have if I were you.
$0.02
Yes it's a worthwhile effort, however as it will not solve your problem. If you have been coding without them you sometimes use them in a mixture of patterns and thing are not always clear. Having names and template may make your code clearer and easier to maintain.
In the last 2 year I have been brushing up on design patterns and how to better model solution, and I believe it has payed off.
I personally read used these books for my studies:
I do think studying design design patterns can help you improve your design. Having clear names will aid people that coming on later.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With