JeroenDeDauw / ParameterProcessor

0 stars 0 forks source link

RFC #1

Open JeroenDeDauw opened 9 years ago

JeroenDeDauw commented 9 years ago

The idea here is to create a new version of ParamProcessor (formerly known as Validator).

High level goals:

Specific measures:

Some initial thoughts on the design can be found in the src folder, in particular the Processor class. I intend to proceed by doing TDD (writing a test for the most basic feature, making it pass and moving on to the next one), and evolve the design further in that fashion. I'm looking for feedback on what the src folder contains so far.

If there is an existing library out there that fulfills these goals, then I'd rather just use that, so please link if you know of one.

JeroenDeDauw commented 9 years ago

@mwjames @mkroetzsch @yaronkoren

mwjames commented 9 years ago

Simplified goals - drop support for edge case behavior that makes the system significantly more complex

If you talk about "drop support for edge case behavior", do you have some in mind and would that require SMW to adjust because it does support some of those "odd" cases?

JeroenDeDauw commented 9 years ago

I wrote that down at https://github.com/JeroenDeDauw/ParameterProcessor/blob/master/src/Processor.php#L36-L60

SMW uses the dependency resolving and non-isolation to support the format parameter. This parameter needs to be processed first, and depending on its value, other parameters are added. Supporting that adds a lot of complexity, and requires the code doing work it simply does not need in almost all cases. SMW can simply first handle the format parameter itself, and once this is done hand over toe the parameter processing tool.

The other case where some code might be altered is where "manipulations" are used. The old model was parse -> validate -> manipulate. The last step just does not seem to belong in a parameter processing tool. What is the benefit of stuffing it in there as opposed to the app doing this itself? Esp considering this code is app specific, and hard to fit into a declarative format.