Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Best way of handling dependent metadata #25
I've came across the following use case and I'm not sure about how to solve it correctly : when I load a class metadata (for instance in loadMetadataFromFile for FileDriver), I need to get data defined by mapping that can possibly be defined by another file driver.
I then use the DriverChain. The problem is how to solve that? I've thought first to create the class metadata, and inject the class metadata into the different drivers so that I have access to it in the loadMetadataFromFile. The problem of course is that I need first to construct the drivers...
The second solution I've found is construct all the drivers, then create the class metadata, and then iterate through the drivers again and call a setter to set the class metadata factory.
What is the best way for that?
EDIT : In fact I think the best way is to create the FileDriverLocator to have all the dirs. So it's easier then.
EDIT 2 : but this won't solve the problem if people use both annotation and file drivers. So I still need to inject it to some point.
Thanks for your help !