-
-
Notifications
You must be signed in to change notification settings - Fork 455
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[QUESTION] Explain about deprecation .yml on entities on docs #776
Comments
@shakaran few things here:
From our point of view (doctrine project), YAML mappings are overhead and added work for little to no benefit to the community besides personal taste of some users. Strict configuration formats like Doctrine ORM mappings MUST be provided within a strict validation framework, in this case provided by static analysis of annotations or XSD/DTD validation in XML. |
Related: symfony/symfony-docs#6752 |
@Ocramius thanks for you time and explanations, very clear to me now ;) |
Its true that XML benefits XST/DTD/Schema. But nothing is perfect including XML. Eventhough XML is a text representation, it is more machine readable rather than human readable, It is too verbose. But YAML although currently lackes DTD/Schema facilities, but is just kind of the pure data. It Elegantly imposes structure on data without the need for messing symbols. A single look on yaml presents data to the developer at a second but It takes more than 10 seconds to read the same XML. Human compatibility is not an irrelevant feature at all. It is the reason for the success of text based network application protocols like HTTP, SMTP, etc. So I think is too important. So It was not so wise to remove support for the yaml presentation. If the tooling dev support was the reason someone could provide converters to XML or Annotations and the remaining processing would work on a single (e.g. XML) presentation. Morover YAML theoretically could have something like DTD/Scheam although currently it may lack one. As you mentioned about being used by Developers not ordinary users, I should mention even 16 year developers (like me) is also a human not a machine and it is better to make things ergonomic. About availability of using IDE/Intellisense, ... its true, but just in the context of creating new code/data and not in the context of reading previous code/data. Even during developing new code one requires frequently reading previous code. So I strongly suggest to get YAML back as it is the most simple, human readable, yet a very powerful and flexible data presentation language. |
OH NO! Yaml should not be removed!! please
So true! |
Few points:
|
Do not remove YAML is not it easier than to remove it? Then there will be both options as it was - "and the sheep are safe and the wolves are full" |
@legalcash the difference is not "remove or not remove". It is "remove the yaml driver or maintain it". Keeping the YAML driver is not a no-op choice. And the ORM maintainers decided to drop it from 3.0. |
And, what do you think about replace YML to JSON? |
Same difference: it still requires us to create a dedicated mapping driver for JSON. I previously thought about using symfony/config for the purpose of extracting mapping data from XML or YAML (or whatever else symfony/config allows you to use) into arrays, and then use that for mapping. There are a few reasons why I haven't started working on that:
I understand that dropping YAML is a source of frustration for a lot of Symfony folks, but please understand the reasons why we're doing it: with our current team strength, it's not feasible to maintain a mapping driver based on a format that is inherently risky because of its lack of schema. With symfony/config, the component itself can validate the provided data against the "schema" you define via Configuration, hopefully catching many of the issues that we've previously had with invalid mapping files before they cause strange issues in the mapping. Thanks for understanding. |
You could just as much have the annotation stuff removed instead, as it is a blatant violation of SOLID / Single Responsibility Principle. |
As far I could read in "latest" doc (which is related to Doctrine 2.x) it seems that still .yml entities are supported
http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/yaml-mapping.html
But from some github issues that I read (not sure if it is written in other place), it seems that from 2.6 or 2.7 an future 3.x from Doctrine, the entities with .yml format will be deprecated and not supported anymore.
I would like know some technical explanation (or maybe not technical) of why drop the support for YML in favour of annotations or XML only. I just try to understand why, I don't judge if keep it is better o not.
Specially for non very technical people, understand a yml file is more easy than anotations or XML and sometimes is more quick to write in yaml format (manually) than XML or annotations
The text was updated successfully, but these errors were encountered: