Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.0.0ALPHA1
    • Fix Version/s: 1.0.0ALPHA1
    • Component/s: None
    • Labels:
      None

      Description

      I know I am nit-picky, I'm really just trying to help, but I think methods like save() that were recently added are just API bloat since all it does is persist + flush. The naming is also confusing, having both save and persist. If you really want to add a method to the public API to exchange 2 lines in user code against 1 line, then at least a more descriptive name would be better, like persistAndFlush().

      API design is difficult, don't take it too lightly (thats what php did, heh)

        Activity

        Hide
        Roman S. Borschel added a comment -

        I think it just really helps ease of use if we keep the different APIs as similar as possible. Of course each can have their own methods, classes etc. We should just not overload the same names with completely different meanings in the different APIs.

        Concerning this example, it just doesnt look very streamlined if there are such minor extra methods like save/persistAndFlush that you don't have in the other APIs and are neither mongo-specific (mongo-specific methods are fine!). Of course we don't want to fit the same API on all these projects, they should just not be too different in weird ways, like additional non-project-specific convenience methods that are available in one project but not in the other.

        I hope I explained that well. It's just about a polished API feeling when using the different Doctrine projects.

        Show
        Roman S. Borschel added a comment - I think it just really helps ease of use if we keep the different APIs as similar as possible. Of course each can have their own methods, classes etc. We should just not overload the same names with completely different meanings in the different APIs. Concerning this example, it just doesnt look very streamlined if there are such minor extra methods like save/persistAndFlush that you don't have in the other APIs and are neither mongo-specific (mongo-specific methods are fine!). Of course we don't want to fit the same API on all these projects, they should just not be too different in weird ways, like additional non-project-specific convenience methods that are available in one project but not in the other. I hope I explained that well. It's just about a polished API feeling when using the different Doctrine projects.
        Hide
        Jonathan H. Wage added a comment -

        I had the same thought when I was adding it and I wobbled back and fourth. Now that you say this I agree we should remove it.

        Show
        Jonathan H. Wage added a comment - I had the same thought when I was adding it and I wobbled back and fourth. Now that you say this I agree we should remove it.

          People

          • Assignee:
            Jonathan H. Wage
            Reporter:
            Roman S. Borschel
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: