Spring Social
  1. Spring Social
  2. SOCIAL-343

Leverage Spring Data for UsersConnectionRepository

    Details

    • Type: New Feature New Feature
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Connection Persistence
    • Labels:
      None

      Description

      As of Spring Social 1.0.2.RELEASE, a central part of Spring Social is the interface org.springframework.social.connect.UsersConnectionRepository. It is used to retrieve social provider-related data of users. The only implementation available to this interface right now is JdbcUsersConnectionRepository.

      Also, there is the related ConnectionRepository which is used to persist provider-related data of users. Its only implementation right now is JdbcConnectionRepository.

      Spring Data makes it easy to set up and maintain repositories: a little configuration and some application-specific interfaces are enough to provide repositories that are transaction-aware and boilerplate-free, among other goodies.

      If Spring Social leveraged Spring Data somehow, I guess that Spring Social's repository-related needs could benefit from Spring Data.

      As for myself, my current application both uses Spring Data repositories and Spring Social's "own" repositories. Having to use both makes it harder for me to reason about the behavior of my underlying database technology: Both use the same javax.sql.DataSource object to access the database. Additionally, modifications to requirements involving the database (e.g. "make any database operation transactional", "handle database exceptions gracefully") requires to analyze both Spring Data-related repositories and Spring Social-related repositories.

      tl;dr: Providing Spring Data-based implementations of Spring Social-related repositories may result in a better application design.

        Activity

        Hide
        Yuan Ji added a comment -

        I'm using MongoDB, and I have to copy lots of code from JdbcUsersConnectionRepository to my MongoUsersConnectionRepository. If we can abstract UsersConnectionRepository implementation code using Spring Data Repository, we can provide a framework for different persistent technologies.

        See my code at http://www.jiwhiz.com/post/2013/1/Customize_Spring_Social_Connect_Framework_For_MongoDB

        Show
        Yuan Ji added a comment - I'm using MongoDB, and I have to copy lots of code from JdbcUsersConnectionRepository to my MongoUsersConnectionRepository. If we can abstract UsersConnectionRepository implementation code using Spring Data Repository, we can provide a framework for different persistent technologies. See my code at http://www.jiwhiz.com/post/2013/1/Customize_Spring_Social_Connect_Framework_For_MongoDB

          People

          • Assignee:
            Craig Walls
            Reporter:
            Gerrit Hübbers
          • Votes:
            4 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated: