last day (19 days later) » 

2:56 PM
2
A: Vehicle Running Cost calculator

TekI couldn't help myself, so here are a few points. Like I said in my comments. class DeliveryVanDataParser resolveData() Your DeliveryVanDataParser looks fishy, specifically resolveData. A data parser should only be parsing data, not including files. This should be the responsibility of anot...

 
Bas
Thanks for your quick answer, Reading and testing it tommorow :)
Isn't DataResolver a beter name then Controller then? Because it will actually get data (arrays) from that specific file.
 
Tek
@Bas Controller is a general term that takes care of wiring your all code together. These are the calls that the Controller makes before rendering a webpage, or API, etc since the Controller also takes care of calling the class to present your data to an HTTP response. Basically each class method in a Controller class is a web page. Everything to present that web page is prepared inside that method.
However, you can ignore the Controller part, it's common to present web pages with controllers in modern applications so I only used the term.
 
Bas
but if i wanted to do it, there should be a Controller for every vehicle type? Also, there isn't an VehicleOwnerParser :)
 
Tek
@Bas Imagine Controller functions like web pages. Each function returns a different page. So in $Controller->vehicleDataPage(); inside you call everything needed to render that page, that's all.
That's beyond the scope of this question so if you're interested in how it works you should check out how modern applications work. Such as symfony.com/doc/current/book/controller.html
@Bas I know there's no VehicleOwnerParser class, I was implying for you to implement that class to be able to fetch data for $Owner
 
Bas
Hmm so Controller === DataResolver then in my case. And i'm already doing that right in my dataParser classes? (parsing the vehicle owner's data)
Indeed, wat Alex said. But what do you mean with all your Parser ideas? I dont really get that.
Updated my post aswell, each array belonging to each vehicle is in a seperate PHP file.
@Tek Can you please add some more code examples of the interfaces and abstract classes you're talking about? Its pretty unclear for me atm.
 
Tek
2:56 PM
@AlexL I did mention it's fine to use static methods as long as they don't call other static methods inside. However, static methods are getting dropped from one the major PHP testing libraries. If not THE testing library for PHP. If you want your future code to be testable I recommend not using them.
@Bas If you can link a zip file with a working example of your code I wouldn't mind doing that. It's inconvenient seeing all your code on one single page.
 
Bas
@Tek I've got it on my github, if you want you can fork it. github.com/basvandriel94/Vehicle-Running-Cost-Calculator
 
Tek
@Bas Even better, I'll take a look
 
Bas
@Tek thank you :)
 
Tek
3:10 PM
I'm currently at work so it might be a while
 
Bas
No problem, same. What did you mean with the interface and abtract class though? :)
 
Tek
Tell you in a bit, starting a meeting :)
 
Bas
3:42 PM
Alright, i'll check it out on your github then later on :) I gotta do some work aswell.
 

  last day (19 days later) »