DOWNLOAD THE ATTACHED FILE FOR FORMATTED TEXT!!! INDENTATION IS IMPORTANT!
To be developed for this task is the following:
The class "ComparableCategory" contains fields for:
- an "identifier" (that may or may not be unique)
- "directChildren" which are the children of that category
this allows the modelling of arbitrary category trees, for example:
- Root
- Subcategory #1
- Subcategory #4
- Subcategory #5
- Subcategory #2
- Subcategory #3
- Subcategory #6
- Subcategory #7
the trees support unlimited depth and siblings.
The scope of this task is to create classes to compare these category trees while returning operations. Operations are defined as follows:
- "MOVE"
Move a subcategory from one PATH to ANOTHER PATH.
- "DELETE"
Delete a subcategory at a given PATH.
- "ADD"
Add a subcategory (/and children) at a given PATH.
The task now is to develop two classes.
- "MoveSupportingComparison"
Abstract: This class allows for comparison of trees based on the identifier being unique between trees.
Implementation: "UniqueIdentifierComparison", passed two root categories, the comparison class returns an array of options that transform $oldTree into $newTree. All options are allowed. Instances may be identified by the identifier, which is to be considered unique for this part of the task.
- "DeleteAndReAddComparison"
Abstract: This class allows for comparison of trees where the identifiers are not unique. Tree elements are identified by checking their children and parent. Parts of the trees to be compared are thus only considered equal when they have the same parent and exactly the same direct children in both trees.
Implementation: "NonUniqueIdentifierComparison", this comparison does not support the MOVE operation. A MOVE operation is substituted with DELETEing the offending Key first and then ADDing the same element anew.
Deliverable is a set of PHP classes. Proposed structure that may be optimized:
- src/
- [login to view URL]
- Comparisons/
- Abstract/
- [login to view URL]
- [login to view URL]
- [login to view URL]
- [login to view URL]
- tests/
- [login to view URL]
- [login to view URL]
It is needed to add a test for each implementation. If you need an example, let me know.
Hi there!
I'm an expert PHP developer , having more than 7+ years of professional experience .
I read your project description carefully , I will build PHP Classes for Tree Comparison as per your given project details and attachement
Let's connect in private chat for further discussion
Thank You
Greetings boss,
We will be more than happy to help you because we are professionals with more than 5YEARS experience. ✓What matters most to us are; your trust, perfect functionality of your project, time uniformity and quick delivery.
✓We work in assemblage of professional computer science graduates under Shaunlee Global Circle Limited, we have several skills and expertise.
✓We can definitely give the best of your project.
Kindly HIRE US and you will never regret hiring us.