SlideShare une entreprise Scribd logo
1  sur  37
Télécharger pour lire hors ligne
クラウド時代のSpring Frameworkの新たな試み

      ~Spring Dataの全貌~ 	
                              2012年11月10日
                           ヴイエムウェア株式会社
    クラウドアプリケーションプラットフォーム テクニカル・エバンジェリスト	
                                   池田 俊彦
                                        	




                                 © 2011 VMware Inc. All rights reserved
⾃自⼰己紹介

            池⽥田俊彦
        twitter:tikeda123
VMware  Cloud  Foundry,Spring関連の
    エバンジェリストとして活動
Agenda	

•  はじめに
•  Spring  Dataとは?
   • Spring  Data  Overview
   • リポジトリ
   • ドメインマッピング
   • テンプレート
•  まとめ

 




    3
Copyright © 2012 VMware, Inc. All rights reserved. This product is protected by U.S. and international copyright and intellectual property laws. VMware products are covered by one or more patents listed at http://www.vmware.com/go/patents .
DataBase  スケールアウトオプション     	



        Database Scaling options
        Centralized Relational Datastore




                                                                                        Federated (NoSQL) Data Store




    4
Copyright © 2012 VMware, Inc. All rights reserved. This product is protected by U.S. and international copyright and intellectual property laws. VMware products are covered by one or more patents listed at http://www.vmware.com/go/patents .
Hard  to  create  a  “one  size  fits  all”  solution
                                                                                                   Fast  Data
                                                                             §  アクセス・パターンの多様化
                                                                             §  モバイル・アプリの急増




                  Big  Data                                                                                                                                                             Flexible  Data
           §  ペタバイト  vs.                                                                                                                                                            §  ⾮非構造化データ
               ギガバイト                                                                                                                                                                 §  開発者の⽣生産性
           §  BIの⼤大衆化




                                                                                                           Cloud
                                                                                     §  仮想化
                                                                                     §  “-‐‑‒as-‐‑‒a-‐‑‒Service”として
    5
Copyright © 2012 VMware, Inc. All rights reserved. This product is protected by U.S. and international copyright and intellectual property laws. VMware products are covered by one or more patents listed at http://www.vmware.com/go/patents .
Spring  Data  Overview 	

Spring  Dataプロジェクトは複数のサブプロジェクトから構成される。




                                                                       Spring  Data  プロジェクト
                                                                                                                                             Document                                                                 Graph
                 Relational  Databases                                                              Data  Grid  
                                                                                                                                                Stores                                                                 Stores



                    JPA                              JDBC                                          GemFire                                  MongoDB                                                                  Neo4J
                                                   Extensions




    6
Copyright © 2012 VMware, Inc. All rights reserved. This product is protected by U.S. and international copyright and intellectual property laws. VMware products are covered by one or more patents listed at http://www.vmware.com/go/patents .
Spring  Data  Overview  



    “Spring  Data  provides  a  familiar  and  consistent  
    Spring-‐‑‒base  programming  model  for  NoSQL  
      and  relational  store  while  retaining  store-‐‑‒specific  
                   features  and  capabilities.  “


   …慣れ親しんだ⼀一貫したSpringベースのプログラミングモデ
   ル…




    7
Copyright © 2012 VMware, Inc. All rights reserved. This product is protected by U.S. and international copyright and intellectual property laws. VMware products are covered by one or more patents listed at http://www.vmware.com/go/patents .
Spring  Data  Overview 	

…慣れ親しんだ⼀一貫したSpringベースのプログラミングモデ
ル…



                                                       ?	
 ?	
                                                      ?	
 ?	

    8
Copyright © 2012 VMware, Inc. All rights reserved. This product is protected by U.S. and international copyright and intellectual property laws. VMware products are covered by one or more patents listed at http://www.vmware.com/go/patents .
Spring  Data  Overview 	

Spring  Framework  の特徴

p Dependency  Injection
            ü 依存性の注⼊入:DI

p Aspect-‐‑‒Oriented  Programming
            ü アスペクト志向プログラミング:AOP

p Portable  Service  Abstraction
            ü データ永続化、スケジュール、トランザクショ
            ンに関する実装とビジネスロジックを疎結合にす
            るための抽象化


                                                                                                                                                                    Simple
                                                                                                                                                                    Object
                                                                                                                                              Portable Service Abstraction



    9
Copyright © 2012 VMware, Inc. All rights reserved. This product is protected by U.S. and international copyright and intellectual property laws. VMware products are covered by one or more patents listed at http://www.vmware.com/go/patents .
Spring  Data  Overview	

                                                                                    Spring  Framework  の特徴

                                                                                     DI  (Dependency  Injection)

                                                                   AOP  (Aspect-‐‑‒Oriented  Programming)

                                                                                  Portable  Service  Abstraction
                                                                                                                                                         Springの特徴を活かした


                                                                                                  Spring  Data
                                                                                                                                                           ⼀一貫したプログラムモデルの提供

                                                                      POJOセントリックなデータアクセスモデル	

                                                                                                                  リポジトリ
                                                                                                   ドメイン・マッピング
                                                                                                              テンプレート
    10
Copyright © 2012 VMware, Inc. All rights reserved. This product is protected by U.S. and international copyright and intellectual property laws. VMware products are covered by one or more patents listed at http://www.vmware.com/go/patents .
リポジトリー
今までのデータアクセスアーキテクチャ 
                                                                       	




                                                                                                                         UI

                                                                                                        Controller

                                                                                            Domain  objects

                                                      Data  Access  (Hibernate,JPA,etc.)




                                                                                                                    SQL DB	


    12
Copyright © 2012 VMware, Inc. All rights reserved. This product is protected by U.S. and international copyright and intellectual property laws. VMware products are covered by one or more patents listed at http://www.vmware.com/go/patents .
今までのデータアクセスアーキテクチャ 
                                                                       	


                                                                                                                         UI

                                                                                                        Controller

                                                                                            Domain  objects

                                                      Data  Access  (Hibernate,JPA,etc.)


                                                                             Relational 	




    13
Copyright © 2012 VMware, Inc. All rights reserved. This product is protected by U.S. and international copyright and intellectual property laws. VMware products are covered by one or more patents listed at http://www.vmware.com/go/patents .
複雑でヘテロなデータアクセスアーキテクチャ  


                                                                                                                         UI

                                                                                                        Controller

                                                                                            Domain  objects
                                                                                                            Data  Access

                             GemFire                                                      JPA                                          MongoDB                                                       Neo4J


                                                                             Relational 	




    14
Copyright © 2012 VMware, Inc. All rights reserved. This product is protected by U.S. and international copyright and intellectual property laws. VMware products are covered by one or more patents listed at http://www.vmware.com/go/patents .
シンプルで統⼀一感のあるデータアクセスアーキテクチャ  


                                                                                                                         UI

                                                                                                        Controller

                                                                                            Domain  objects

                                                                           Spring  Data  Repository


                                                                             Relational 	




    15
Copyright © 2012 VMware, Inc. All rights reserved. This product is protected by U.S. and international copyright and intellectual property laws. VMware products are covered by one or more patents listed at http://www.vmware.com/go/patents .
リポジトリ
“Mediates between the domain and data mapping layers using a
collection-like interface for accessing domain objects.”
 http://martinfowler.com/eaaCatalog/repository.html	



「ドメインドオブジェクトをアクセスするインタフェース群を使い、ドメ
インレイヤとデータマッピングレイヤを仲介する。」




 http://msdn.microsoft.com/en-us/library/ff649690.aspx
Spring  Data  Repository  RDMとNoSQL共通したインタフェースを提供

 Repository	
 public interface Repository<T, ID extends Serializable >{
            …….
 }
ドメインオブジェクトに対する基本インタフェース


 CrudRepository	
 public interface CrudRepository<T, ID extends Serializable >
            extends Repository<T, ID> {
            …….
 }
 ドメインオブジェクトに対するCRUD(Create-‐‑‒Read-‐‑‒Update-‐‑‒Delete  )操作を⾏行行うインタフェース


PagingAndSortingRepository	
  public interface PagingAndSoringRepository<T, ID extends Serializable >
             extends CrudRepository<T, ID> {
             …….
  }
  ドメインオブジェクトに対するソート処理理やページ付け処理理操作を⾏行行うインタフェース

    17
Copyright © 2012 VMware, Inc. All rights reserved. This product is protected by U.S. and international copyright and intellectual property laws. VMware products are covered by one or more patents listed at http://www.vmware.com/go/patents .
Spring  Data  Repository  今までの(JPAのみ)アプローチ	
public interface CustomerRepository {
             Customer save(Customer account);
             Customer findByEmailAddress(EmailAddress emailAddress);
}

@Repository
@Transactional(readOnly = true)
class JpaCustomerRepository implements CustomerRepository {
   @PersistenceContext
   private EntityManager em;

   @Override
   @Transactional
   public Customer save(Customer customer) {
      if (customer.getId() == null) {
       em.persist(customer);
       return customer;
       } else {
       return em.merge(customer);
      }
   }

        @Override
        public Customer findByEmailAddress(EmailAddress emailAddress) {
           TypedQuery<Customer> query = em.createQuery( "select c from Customer c where c.emailAddress
            = :emailAddress", Customer.class);
            query.setParameter("emailAddress", emailAddress);
            return query.getSingleResult();
        }
  }

      18
Copyright © 2012 VMware, Inc. All rights reserved. This product is protected by U.S. and international copyright and intellectual property laws. VMware products are covered by one or more patents listed at http://www.vmware.com/go/patents .
Spring  Data  Repository  Spring  Dataを使ったアプローチ	

public interface CustomerRepository extends Repository<Customer Long>{
       @Transaction(timeout = 60)
          Customer save(Customer account);

                           Customer findByEmailAddress(EmailAddress emailAddress);
}
インタフェースに使いたいメソッドを定義するだけ。トランザクションを指定する場合は、@Transaction
を記述する。




    19
Copyright © 2012 VMware, Inc. All rights reserved. This product is protected by U.S. and international copyright and intellectual property laws. VMware products are covered by one or more patents listed at http://www.vmware.com/go/patents .
“naming  conventions”  によるクエリメソッドの定義  


public interface PagingAndSoringRepository<T, ID extends Serializable >
           extends CrudRepository<T, ID> {
     Iterable<T>     findAll(Sort sort);
     Page<T>         findAll(Pageable pageable);
}




public interface PersonRepository extends CrudRepository<Person, BigInteger> {
    // Finder for a single entity
   Person findByEmailAddress(String emailAddress);

   // Finder for a multiple entities
   List<Person> findByLastnameLike(String lastName);

   // Finder with pagination
   Page<Person> findByFirstnameLike(String firstName, Pageable page);
}



    20
Copyright © 2012 VMware, Inc. All rights reserved. This product is protected by U.S. and international copyright and intellectual property laws. VMware products are covered by one or more patents listed at http://www.vmware.com/go/patents .
Spring  Data  Repository    クエリー	
  JPA  クエリメソッド(Naming  convertions  ベース)

  •  Query  annotation  でオーバーライド可能
  •  JPA  named  query  (@NamedQuery)  の参照も可

  •  JPAの場合、JPQLをアノテーションにより記述、MongoDB(GeoSptialも対応),Neo4(cypher)
  も同様に対応可能。

public interface PersonRepository extends CrudRepository<Person,BigInteger> {

// previous methods omitted...
@Query("select p from Person p where p.emailAddress = ?1”)

 Person findByEmailAddress(String emailAddress);
@Query("select p from Person p where p.firstname = :firstname or p.lastname = :lastname") Person
findByLastnameOrFirstname(       @Param("lastname") String lastname,
                                 @Param("firstname") String firstname);
}




    21
Copyright © 2012 VMware, Inc. All rights reserved. This product is protected by U.S. and international copyright and intellectual property laws. VMware products are covered by one or more patents listed at http://www.vmware.com/go/patents .
Spring  Data  Repository  Spring  Data  Repository設定	

xml  namespaceによる定義
<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns:beans="http://www.springframework.org/schema/beans"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance”
         …….
         http://www.springframework.org/schema/data/jpa/spring-jpa.xsd">

                         <jpa:repositories base-package="com.acme.**.repository" />
</beans>

上記はJPAの例例、mongodbの場合は<mongo:repositories…/>、neo4jの場合は
<neo4j:repositories…/>


JavaConfigによる定義
@Configuration
@EnableJpaRepositories
class ApplicationConfig {
}

上記はJPAの例例、mongodbの場合は@EnableMongoRepositories、neo4jの場合は
@EnableNeo4jRepositories

    22
Copyright © 2012 VMware, Inc. All rights reserved. This product is protected by U.S. and international copyright and intellectual property laws. VMware products are covered by one or more patents listed at http://www.vmware.com/go/patents .
Spring  Data  Repository  Spring  Data  Repositoryの使い⽅方	

CrudRepositoryインタフェースの拡張及びQueryメソッドの定義
public interface ProductRepository extends CrudRepository<Product, Long> {
 Page<Product> findByDescriptionContaining(String description, Pageable pageable);

    @Query("select p from Product p where p.attributes[?1] = ?2")
    List<Product> findByAttributeAndValue(String attribute, String value);
}


@Autowired
ProductRepository repository;

@Test
public void lookupProductsByDescription() {
   Pageable pageable = new PageRequest(0, 1, Direction.DESC, "name");
   Page<Product> page = repository.findByDescriptionContaining("Apple", pageable);

   assertThat(page.getContent(), hasSize(1));
   assertThat(page, Matchers.<Product> hasItems(named(“iPad”)));       
   ……
}

    23
Copyright © 2012 VMware, Inc. All rights reserved. This product is protected by U.S. and international copyright and intellectual property laws. VMware products are covered by one or more patents listed at http://www.vmware.com/go/patents .
Spring  Data  Repository  メリット	




                            共通(SQL,NoSQL)のインタフェースとして利利⽤用

                   “boiler-‐‑‒plate  code(お決まりごとのコード)”の排除

      クエリをアノテーションを使って簡単にアノテーションメソ
                ッドとして定義




    24
Copyright © 2012 VMware, Inc. All rights reserved. This product is protected by U.S. and international copyright and intellectual property laws. VMware products are covered by one or more patents listed at http://www.vmware.com/go/patents .
ドメイン・マッピング




    25
Copyright © 2012 VMware, Inc. All rights reserved. This product is protected by U.S. and international copyright and intellectual property laws. VMware products are covered by one or more patents listed at http://www.vmware.com/go/patents .
ドメイン・マッピング

     Javaのオブジェクトをそれぞれのデータストアのデータ構造にマッピング
     ただし、データ構造が違うので、共通したインタフェースは持てない。
                                                                          public  class  Person{
                                                                                  private  BigInteger    id;
                                                                                  private  String  firstname,  lastname;
                                                                                  private  EmailAddress  emailAdress;
                                                                                  ……..
                                                                          }  


                                                                                      マッピング	



                                                                             Relational 	




    26
Copyright © 2012 VMware, Inc. All rights reserved. This product is protected by U.S. and international copyright and intellectual property laws. VMware products are covered by one or more patents listed at http://www.vmware.com/go/patents .
ドメイン・マッピング      リレーショナルDB(JPA)	


                           PERSON	
                                                                                                           @Entity
    Id                         fname                              lname
(INTEGAR)                    (VARCHAR)                          (VARCHAR)
                                                                                                                                              @Table(name=”CPERSON”)
                                                                                                                                              public class Person{

                                                                                                                                                  @Id
                                                                                                                                                  private int Id;
                                                                                                              O/R
                                                                                                            マッピング                                 @Column(name=“fname”)
         ADDRESS	
   city                            street                                                                                                         private String Firstname;
(VARCHAR)                       (VARCHAR)                                                                                                         @Column(name=“lname”)
                                                                                                                                                  private String Lastname;

                                                                                                                                                  @OneToMany
                                                                                                                                                  private List Addres;
                                                                                                                                              }




    27
Copyright © 2012 VMware, Inc. All rights reserved. This product is protected by U.S. and international copyright and intellectual property laws. VMware products are covered by one or more patents listed at http://www.vmware.com/go/patents .
ドメイン・マッピング    ドキュメントタイプ(MongoDB)	



                                                                                                                                              @Document(
                                                                                                                                              collection=”CPERSON”)
                                                                                                                                              public class Person{
{ Id:”100”
  fname : ”Toshihiko",                                                                                                                            @Id
  lname : ”Ikeda",                                                                                                                                private int Id;
  addresses : [ {city : ”Musashino",                                                                        マッピング
  street : ”yamanote-3-2-6" } ] }	
                                                                                                               @Field(“fname”)
                                                                                                                                                  private String Firstname;
                                                                                                                                                  @Field(“lname”)
                                                                                                                                                  private String Lastname;

                                                                                                                                                  private List Address;
                                                                                                                                              }




    28
Copyright © 2012 VMware, Inc. All rights reserved. This product is protected by U.S. and international copyright and intellectual property laws. VMware products are covered by one or more patents listed at http://www.vmware.com/go/patents .
ドメイン・マッピング    ドキュメントタイプ  	

 Spring  Dataを使わないケース(マッピングコードを⾃自分で書いた場合)
   public void mongoBasic() throws Exception {
              Mongo mongo = new Mongo();
              DB db = mongo.getDB("database");
              DBCollection customers = db.getCollection("customers");

                              DBObject address = new BasicDBObject("city", ”Kobe");
                              address.put("street", "Broadway");
                              DBObject addresses = new BasicDBList();
                              ((BasicDBList) addresses).add(address);
                              DBObject customer = new BasicDBObject("firstname", "Tsuyoshi");
                              customer.put("lastname", "Miyake");
                              ustomer.put("addresses", addresses);

                              customers.insert(customer);
                              System.out.println(customers.findOne());
   }

   Insert  /  Updateに対するコードなど
   •  (全ての)アプリケーション  POJO  -‐‑‒>  DBObject  にマップする必要あり  
   •  mongo.getDatabase(...).getCollection(...).insert(...)。




    29
Copyright © 2012 VMware, Inc. All rights reserved. This product is protected by U.S. and international copyright and intellectual property laws. VMware products are covered by one or more patents listed at http://www.vmware.com/go/patents .
ドメイン・マッピング  グラフDB	



                                                                                                                                              @NodeEntity
                                                           firstname :
                                                               Mike                                                                           public class Person{

                                                                                                                                                  @GraphId
Person	
                                                                                                                                          private int Id;
                                                                                                          マッピング
                                 Address :                                                                                                        private String Firstname;
firstname :                      Midori-cho	
                       firstname :                                                                   private String Lastname;
 Toshihiko                                                              John
                                                                                                                                                  @RelatedTo(type = ”ADDRESS",
                                                                                                                                                  direction = Direction.OUTGOING)
                                                                                                                                                  private List Address;
                                                                                                                                              }




    30
Copyright © 2012 VMware, Inc. All rights reserved. This product is protected by U.S. and international copyright and intellectual property laws. VMware products are covered by one or more patents listed at http://www.vmware.com/go/patents .
ドメイン・マッピング    グラフDB  	

 Spring  Dataを使わないケース(マッピングコードを⾃自分で書いた場合)
   public class Person {
              private final Node underlyingNode;

                              public Person(final Node node) {
                                         underlyingNode = node;
                              }

                              public Node getUnderlyingNode() {
                                        return underlyingNode;
                              }

                              public final String getName() {
                                          return (String) underlyingNode.getProperty(“name”);
                               }
                              public void setName(final String name) {
                                          underlyingNode.setProperty(“name”, name);
                              }
   }

   TypeSafeでない記述  underlyingNode.getProperty(“name”);




    31
Copyright © 2012 VMware, Inc. All rights reserved. This product is protected by U.S. and international copyright and intellectual property laws. VMware products are covered by one or more patents listed at http://www.vmware.com/go/patents .
ドメイン・マッピング  メリット	




                                       POJOセントリックなプログラミングが可能

 データ構造が違うので、共通したインタフェースは持てないが
    アノテーションを使ってデータストアの特質を表現




    32
Copyright © 2012 VMware, Inc. All rights reserved. This product is protected by U.S. and international copyright and intellectual property laws. VMware products are covered by one or more patents listed at http://www.vmware.com/go/patents .
テンプレート




    33
Copyright © 2012 VMware, Inc. All rights reserved. This product is protected by U.S. and international copyright and intellectual property laws. VMware products are covered by one or more patents listed at http://www.vmware.com/go/patents .
テンプレート


低レイヤの例例外処理理、リソース管理理に煩わすことなく、                                                                                                                                                                                 Exception
実装に専念念できる。                                                                                                                                                                                                   Translation	

                                                                                                                                                                             ドライバ実装によって例外ハンドリングが違う。
                                Spring  Data  Repository                                                                                                                     例外を受け取り、開発者へ適切に再スロー	



                         JPA                                     MongoTemplate                                              Neo4jTemplate

                                                                  MongoDB driver	
                                            Neo4J driver	
                                                                                                                                                                                               リソースマネジメント	
                                                                                                                                                                                       適切なリソースの確保、リソースの解放	

            Relational 	




    34
Copyright © 2012 VMware, Inc. All rights reserved. This product is protected by U.S. and international copyright and intellectual property laws. VMware products are covered by one or more patents listed at http://www.vmware.com/go/patents .
まとめ	

                慣れ親しんだ⼀一貫したSpringベースのプログラミングモデル提供


            Springの特徴を活かしたPOJOセントリックなデータアクセスモデル



                                                                                                                                                  メリット
                                                                             •  共通(SQL,NoSQL)のインタフェースとして利利⽤用
                                                                             •  “boiler-‐‑‒plate  code(お決まりごとのコード)”の排除
                        リポジトリ                                                •  クエリをアノテーションを使って簡単にアノテーションメ
                                                                                ソッドとして定義
                                                                             •  POJOセントリックなプログラミングが可能
          ドメイン・マッピング                                                         •  データ構造が違うので、共通したインタフェースは持てな
                                                                                いがアノテーションを使ってデータストアの特質を表現
                                                                             •  低レイヤの例例外処理理、リソース管理理に煩わすことなく、実
                    テンプレート                                                      装に専念念できる。



    35
Copyright © 2012 VMware, Inc. All rights reserved. This product is protected by U.S. and international copyright and intellectual property laws. VMware products are covered by one or more patents listed at http://www.vmware.com/go/patents .
Spring  Dataコアエンジニアの来⽇日決定

                                                      12/9    18:00〜~21:00  
                                                     VMware  浜松町オフィス

                                                  Spring  Dataの神髄を語る
                                           参加希望者は、以下のURLから登録ください。
                                           http://atnd.org/events/34055	

       Engineer at SpringSource	
                                                                          Oliver Gierke is engineer at SpringSource, a division of VMware,
                                                                          project lead of the Spring Data JPA module and involved into other
                                                                          Spring Data modules (e.g. MongoDB) as well. He has been into
                                                                          developing enterprise applications and open source projects for
                                                                          over 6 years now. His working focus is centered around software
                                                                          architecture, Spring and persistence technologies. He is regularly
                                                                          speaking at German and international conferences as well as
                                                                          author of technology articles.	
                     Oliver Gierke	
    36
Copyright © 2012 VMware, Inc. All rights reserved. This product is protected by U.S. and international copyright and intellectual property laws. VMware products are covered by one or more patents listed at http://www.vmware.com/go/patents .
Spring Data for JJUG for Cross Conference Fall

Contenu connexe

Tendances

Transform Microsoft Application Environment With EMC Information Infrastructure
Transform Microsoft Application Environment With EMC Information InfrastructureTransform Microsoft Application Environment With EMC Information Infrastructure
Transform Microsoft Application Environment With EMC Information InfrastructureEMC Forum India
 
Innovations in Data Grid Technology with Oracle Coherence
Innovations in Data Grid Technology with Oracle CoherenceInnovations in Data Grid Technology with Oracle Coherence
Innovations in Data Grid Technology with Oracle CoherenceBob Rhubart
 
SSD: Ready for Enterprise and Cloud?
SSD: Ready for Enterprise and Cloud?SSD: Ready for Enterprise and Cloud?
SSD: Ready for Enterprise and Cloud?IMEX Research
 
Application Grid: Platform for Virtualization and Consolidation of your Java ...
Application Grid: Platform for Virtualization and Consolidation of your Java ...Application Grid: Platform for Virtualization and Consolidation of your Java ...
Application Grid: Platform for Virtualization and Consolidation of your Java ...Bob Rhubart
 
Do More with Oracle Environment with Open and Best of breed Technologies
Do More with Oracle Environment with Open and Best of breed TechnologiesDo More with Oracle Environment with Open and Best of breed Technologies
Do More with Oracle Environment with Open and Best of breed TechnologiesEMC Forum India
 
Cloud Computing: Making IT Simple
Cloud Computing: Making IT SimpleCloud Computing: Making IT Simple
Cloud Computing: Making IT SimpleBob Rhubart
 
Engineered Systems: Oracle’s Vision for the Future
Engineered Systems: Oracle’s Vision for the FutureEngineered Systems: Oracle’s Vision for the Future
Engineered Systems: Oracle’s Vision for the FutureBob Rhubart
 
Future Proofing MySQL by Robert Hodges, Continuent
Future Proofing MySQL by Robert Hodges, ContinuentFuture Proofing MySQL by Robert Hodges, Continuent
Future Proofing MySQL by Robert Hodges, ContinuentEero Teerikorpi
 
VMUG ISRAEL November 2012, EMC session by Itzik Reich
VMUG ISRAEL November 2012, EMC session by Itzik ReichVMUG ISRAEL November 2012, EMC session by Itzik Reich
VMUG ISRAEL November 2012, EMC session by Itzik ReichItzik Reich
 
IGC Solutions for IBM ECM
IGC Solutions for IBM ECMIGC Solutions for IBM ECM
IGC Solutions for IBM ECMkaterogersbrown
 
MS TechDays 2011 - Virtualization Solutions to Optimize Performance
MS TechDays 2011 - Virtualization Solutions to Optimize PerformanceMS TechDays 2011 - Virtualization Solutions to Optimize Performance
MS TechDays 2011 - Virtualization Solutions to Optimize PerformanceSpiffy
 
Emulex Presents Why I/O is Strategic Global Survey Results
Emulex Presents Why I/O is Strategic Global Survey ResultsEmulex Presents Why I/O is Strategic Global Survey Results
Emulex Presents Why I/O is Strategic Global Survey ResultsEmulex Corporation
 
21st Century SOA
21st Century SOA21st Century SOA
21st Century SOABob Rhubart
 
Rio Info 2009 - Optimizing IT Costs using Virtualization, Green and Cloud Com...
Rio Info 2009 - Optimizing IT Costs using Virtualization, Green and Cloud Com...Rio Info 2009 - Optimizing IT Costs using Virtualization, Green and Cloud Com...
Rio Info 2009 - Optimizing IT Costs using Virtualization, Green and Cloud Com...Rio Info
 
German in 7 Million Shared Objects
German in 7 Million  Shared ObjectsGerman in 7 Million  Shared Objects
German in 7 Million Shared ObjectsESUG
 
OpenStack: Time is Now - Lew Tucker
OpenStack: Time is Now - Lew TuckerOpenStack: Time is Now - Lew Tucker
OpenStack: Time is Now - Lew TuckerLew Tucker
 
Falcon Stor Enables Virtual SANs For V Mware
Falcon Stor Enables Virtual SANs For V MwareFalcon Stor Enables Virtual SANs For V Mware
Falcon Stor Enables Virtual SANs For V MwarePaul Skach
 

Tendances (19)

Transform Microsoft Application Environment With EMC Information Infrastructure
Transform Microsoft Application Environment With EMC Information InfrastructureTransform Microsoft Application Environment With EMC Information Infrastructure
Transform Microsoft Application Environment With EMC Information Infrastructure
 
Innovations in Data Grid Technology with Oracle Coherence
Innovations in Data Grid Technology with Oracle CoherenceInnovations in Data Grid Technology with Oracle Coherence
Innovations in Data Grid Technology with Oracle Coherence
 
Why Mashups Matter
Why Mashups MatterWhy Mashups Matter
Why Mashups Matter
 
SSD: Ready for Enterprise and Cloud?
SSD: Ready for Enterprise and Cloud?SSD: Ready for Enterprise and Cloud?
SSD: Ready for Enterprise and Cloud?
 
Application Grid: Platform for Virtualization and Consolidation of your Java ...
Application Grid: Platform for Virtualization and Consolidation of your Java ...Application Grid: Platform for Virtualization and Consolidation of your Java ...
Application Grid: Platform for Virtualization and Consolidation of your Java ...
 
Do More with Oracle Environment with Open and Best of breed Technologies
Do More with Oracle Environment with Open and Best of breed TechnologiesDo More with Oracle Environment with Open and Best of breed Technologies
Do More with Oracle Environment with Open and Best of breed Technologies
 
Cloud Computing: Making IT Simple
Cloud Computing: Making IT SimpleCloud Computing: Making IT Simple
Cloud Computing: Making IT Simple
 
Engineered Systems: Oracle’s Vision for the Future
Engineered Systems: Oracle’s Vision for the FutureEngineered Systems: Oracle’s Vision for the Future
Engineered Systems: Oracle’s Vision for the Future
 
Future Proofing MySQL by Robert Hodges, Continuent
Future Proofing MySQL by Robert Hodges, ContinuentFuture Proofing MySQL by Robert Hodges, Continuent
Future Proofing MySQL by Robert Hodges, Continuent
 
VMUG ISRAEL November 2012, EMC session by Itzik Reich
VMUG ISRAEL November 2012, EMC session by Itzik ReichVMUG ISRAEL November 2012, EMC session by Itzik Reich
VMUG ISRAEL November 2012, EMC session by Itzik Reich
 
IGC Solutions for IBM ECM
IGC Solutions for IBM ECMIGC Solutions for IBM ECM
IGC Solutions for IBM ECM
 
MS TechDays 2011 - Virtualization Solutions to Optimize Performance
MS TechDays 2011 - Virtualization Solutions to Optimize PerformanceMS TechDays 2011 - Virtualization Solutions to Optimize Performance
MS TechDays 2011 - Virtualization Solutions to Optimize Performance
 
Emulex Presents Why I/O is Strategic Global Survey Results
Emulex Presents Why I/O is Strategic Global Survey ResultsEmulex Presents Why I/O is Strategic Global Survey Results
Emulex Presents Why I/O is Strategic Global Survey Results
 
21st Century SOA
21st Century SOA21st Century SOA
21st Century SOA
 
Rio Info 2009 - Optimizing IT Costs using Virtualization, Green and Cloud Com...
Rio Info 2009 - Optimizing IT Costs using Virtualization, Green and Cloud Com...Rio Info 2009 - Optimizing IT Costs using Virtualization, Green and Cloud Com...
Rio Info 2009 - Optimizing IT Costs using Virtualization, Green and Cloud Com...
 
Extreme Competition
Extreme CompetitionExtreme Competition
Extreme Competition
 
German in 7 Million Shared Objects
German in 7 Million  Shared ObjectsGerman in 7 Million  Shared Objects
German in 7 Million Shared Objects
 
OpenStack: Time is Now - Lew Tucker
OpenStack: Time is Now - Lew TuckerOpenStack: Time is Now - Lew Tucker
OpenStack: Time is Now - Lew Tucker
 
Falcon Stor Enables Virtual SANs For V Mware
Falcon Stor Enables Virtual SANs For V MwareFalcon Stor Enables Virtual SANs For V Mware
Falcon Stor Enables Virtual SANs For V Mware
 

En vedette

VI Ruta del Pintxo MUGAN - Recetario
VI Ruta del Pintxo MUGAN - RecetarioVI Ruta del Pintxo MUGAN - Recetario
VI Ruta del Pintxo MUGAN - RecetarioMugan
 
The world is flat
The world is flatThe world is flat
The world is flatAdlina
 
Activity week
Activity weekActivity week
Activity weekAdlina
 
Catálogo Basic 2012 de Exter
Catálogo Basic 2012 de ExterCatálogo Basic 2012 de Exter
Catálogo Basic 2012 de ExterMugan
 
9º CONCURSO DE FOTOGRAFÍA - IRUN, COMERCIO Y CIUDAD
9º CONCURSO DE FOTOGRAFÍA - IRUN, COMERCIO Y CIUDAD9º CONCURSO DE FOTOGRAFÍA - IRUN, COMERCIO Y CIUDAD
9º CONCURSO DE FOTOGRAFÍA - IRUN, COMERCIO Y CIUDADMugan
 
Royal Botania - Red Label
Royal Botania - Red LabelRoyal Botania - Red Label
Royal Botania - Red LabelMugan
 
สถาปัตยกรรมสมัยกรุงศรีอยุธยา
สถาปัตยกรรมสมัยกรุงศรีอยุธยาสถาปัตยกรรมสมัยกรุงศรีอยุธยา
สถาปัตยกรรมสมัยกรุงศรีอยุธยาlnw22nut
 
Cloud FoundryではじめるPaaSアプリケーション 開発入門講座
Cloud FoundryではじめるPaaSアプリケーション 開発入門講座 Cloud FoundryではじめるPaaSアプリケーション 開発入門講座
Cloud FoundryではじめるPaaSアプリケーション 開発入門講座 Toshihiko Ikeda
 
Instructional Multimedia Development
Instructional Multimedia DevelopmentInstructional Multimedia Development
Instructional Multimedia DevelopmentPinoy Guro
 
How to Create a Learning Managment System
How to Create a Learning Managment SystemHow to Create a Learning Managment System
How to Create a Learning Managment SystemPinoy Guro
 
第8回CloudFoundry輪読会発表資料(Node.js on Cloud Foundry)
第8回CloudFoundry輪読会発表資料(Node.js on Cloud Foundry)第8回CloudFoundry輪読会発表資料(Node.js on Cloud Foundry)
第8回CloudFoundry輪読会発表資料(Node.js on Cloud Foundry)Toshihiko Ikeda
 
第一回Cloudfoundry輪読会資料
第一回Cloudfoundry輪読会資料第一回Cloudfoundry輪読会資料
第一回Cloudfoundry輪読会資料Toshihiko Ikeda
 
Interactive Teaching Strategies
Interactive Teaching StrategiesInteractive Teaching Strategies
Interactive Teaching StrategiesPinoy Guro
 

En vedette (19)

VI Ruta del Pintxo MUGAN - Recetario
VI Ruta del Pintxo MUGAN - RecetarioVI Ruta del Pintxo MUGAN - Recetario
VI Ruta del Pintxo MUGAN - Recetario
 
Cf spring insight
Cf spring insightCf spring insight
Cf spring insight
 
The world is flat
The world is flatThe world is flat
The world is flat
 
Que es el_anglicanismo
Que es el_anglicanismoQue es el_anglicanismo
Que es el_anglicanismo
 
Activity week
Activity weekActivity week
Activity week
 
App.net Introduction
App.net IntroductionApp.net Introduction
App.net Introduction
 
Catálogo Basic 2012 de Exter
Catálogo Basic 2012 de ExterCatálogo Basic 2012 de Exter
Catálogo Basic 2012 de Exter
 
9º CONCURSO DE FOTOGRAFÍA - IRUN, COMERCIO Y CIUDAD
9º CONCURSO DE FOTOGRAFÍA - IRUN, COMERCIO Y CIUDAD9º CONCURSO DE FOTOGRAFÍA - IRUN, COMERCIO Y CIUDAD
9º CONCURSO DE FOTOGRAFÍA - IRUN, COMERCIO Y CIUDAD
 
Royal Botania - Red Label
Royal Botania - Red LabelRoyal Botania - Red Label
Royal Botania - Red Label
 
Hm libro de_oracion_comun
Hm libro de_oracion_comunHm libro de_oracion_comun
Hm libro de_oracion_comun
 
สถาปัตยกรรมสมัยกรุงศรีอยุธยา
สถาปัตยกรรมสมัยกรุงศรีอยุธยาสถาปัตยกรรมสมัยกรุงศรีอยุธยา
สถาปัตยกรรมสมัยกรุงศรีอยุธยา
 
La biblia-de-nuestro-pueblo
La biblia-de-nuestro-puebloLa biblia-de-nuestro-pueblo
La biblia-de-nuestro-pueblo
 
Cloud FoundryではじめるPaaSアプリケーション 開発入門講座
Cloud FoundryではじめるPaaSアプリケーション 開発入門講座 Cloud FoundryではじめるPaaSアプリケーション 開発入門講座
Cloud FoundryではじめるPaaSアプリケーション 開発入門講座
 
Springon cloudfoundry
Springon cloudfoundrySpringon cloudfoundry
Springon cloudfoundry
 
Instructional Multimedia Development
Instructional Multimedia DevelopmentInstructional Multimedia Development
Instructional Multimedia Development
 
How to Create a Learning Managment System
How to Create a Learning Managment SystemHow to Create a Learning Managment System
How to Create a Learning Managment System
 
第8回CloudFoundry輪読会発表資料(Node.js on Cloud Foundry)
第8回CloudFoundry輪読会発表資料(Node.js on Cloud Foundry)第8回CloudFoundry輪読会発表資料(Node.js on Cloud Foundry)
第8回CloudFoundry輪読会発表資料(Node.js on Cloud Foundry)
 
第一回Cloudfoundry輪読会資料
第一回Cloudfoundry輪読会資料第一回Cloudfoundry輪読会資料
第一回Cloudfoundry輪読会資料
 
Interactive Teaching Strategies
Interactive Teaching StrategiesInteractive Teaching Strategies
Interactive Teaching Strategies
 

Similaire à Spring Data for JJUG for Cross Conference Fall

Accel Partners New Data Workshop 7-14-10
Accel Partners New Data Workshop 7-14-10Accel Partners New Data Workshop 7-14-10
Accel Partners New Data Workshop 7-14-10keirdo1
 
Patterns of Cloud Applications Using Microsoft Azure Services Platform
Patterns of Cloud Applications Using Microsoft Azure Services PlatformPatterns of Cloud Applications Using Microsoft Azure Services Platform
Patterns of Cloud Applications Using Microsoft Azure Services PlatformDavid Chou
 
SAP NetWeaver Portal OnDevice - Consuming your SAP NetWeaver Portal On Mobile...
SAP NetWeaver Portal OnDevice - Consuming your SAP NetWeaver Portal On Mobile...SAP NetWeaver Portal OnDevice - Consuming your SAP NetWeaver Portal On Mobile...
SAP NetWeaver Portal OnDevice - Consuming your SAP NetWeaver Portal On Mobile...SAP Portal
 
Optimizing HTML5 Sites with CQ5/WEM
Optimizing HTML5 Sites with CQ5/WEMOptimizing HTML5 Sites with CQ5/WEM
Optimizing HTML5 Sites with CQ5/WEMGabriel Walt
 
3 12-2013 performance-testing_service_virtualization
3 12-2013 performance-testing_service_virtualization3 12-2013 performance-testing_service_virtualization
3 12-2013 performance-testing_service_virtualizationsilviasiqueirahp
 
Cloud Computing & Scaling Web Apps
Cloud Computing & Scaling Web AppsCloud Computing & Scaling Web Apps
Cloud Computing & Scaling Web AppsMark Slingsby
 
Aras PLM Roadmap
Aras PLM RoadmapAras PLM Roadmap
Aras PLM RoadmapAras
 
Standard Issue: Preparing for the Future of Data Management
Standard Issue: Preparing for the Future of Data ManagementStandard Issue: Preparing for the Future of Data Management
Standard Issue: Preparing for the Future of Data ManagementInside Analysis
 
Building an IaaS cloud
Building an IaaS cloudBuilding an IaaS cloud
Building an IaaS cloudFlexiant
 
UI innovation with SAP NetWeaver Gateway
UI innovation with SAP NetWeaver GatewayUI innovation with SAP NetWeaver Gateway
UI innovation with SAP NetWeaver GatewayJohn Moy
 
WebLogic 12c Developer Deep Dive at Oracle Develop India 2012
WebLogic 12c Developer Deep Dive at Oracle Develop India 2012WebLogic 12c Developer Deep Dive at Oracle Develop India 2012
WebLogic 12c Developer Deep Dive at Oracle Develop India 2012Arun Gupta
 
Open_unified_dataprotection_framework
Open_unified_dataprotection_frameworkOpen_unified_dataprotection_framework
Open_unified_dataprotection_frameworkLowell Abraham
 
Automating Security for the Cloud - Make it Easy, Make it Safe
Automating Security for the Cloud - Make it Easy, Make it SafeAutomating Security for the Cloud - Make it Easy, Make it Safe
Automating Security for the Cloud - Make it Easy, Make it SafeCloudPassage
 
The spring 32 update final
The spring 32 update finalThe spring 32 update final
The spring 32 update finalJoshua Long
 
Cloud foundry elastic architecture and deploy based on openstack
Cloud foundry elastic architecture and deploy based on openstackCloud foundry elastic architecture and deploy based on openstack
Cloud foundry elastic architecture and deploy based on openstackOpenCity Community
 
Leveraging The Clouds For Reliable Web Applications Presentation
Leveraging The Clouds For Reliable Web Applications PresentationLeveraging The Clouds For Reliable Web Applications Presentation
Leveraging The Clouds For Reliable Web Applications PresentationWeb 2.0 Expo
 
Self-Service Access and Exploration of Big Data
Self-Service Access and Exploration of Big DataSelf-Service Access and Exploration of Big Data
Self-Service Access and Exploration of Big DataInside Analysis
 
14h00 aws deck-summit2012_sap_on_aws_s_jones_final
14h00   aws deck-summit2012_sap_on_aws_s_jones_final14h00   aws deck-summit2012_sap_on_aws_s_jones_final
14h00 aws deck-summit2012_sap_on_aws_s_jones_finalLuiz Gustavo Santos
 
Virtualizing Latency Sensitive Workloads and vFabric GemFire
Virtualizing Latency Sensitive Workloads and vFabric GemFireVirtualizing Latency Sensitive Workloads and vFabric GemFire
Virtualizing Latency Sensitive Workloads and vFabric GemFireCarter Shanklin
 

Similaire à Spring Data for JJUG for Cross Conference Fall (20)

Accel Partners New Data Workshop 7-14-10
Accel Partners New Data Workshop 7-14-10Accel Partners New Data Workshop 7-14-10
Accel Partners New Data Workshop 7-14-10
 
Patterns of Cloud Applications Using Microsoft Azure Services Platform
Patterns of Cloud Applications Using Microsoft Azure Services PlatformPatterns of Cloud Applications Using Microsoft Azure Services Platform
Patterns of Cloud Applications Using Microsoft Azure Services Platform
 
SAP NetWeaver Portal OnDevice - Consuming your SAP NetWeaver Portal On Mobile...
SAP NetWeaver Portal OnDevice - Consuming your SAP NetWeaver Portal On Mobile...SAP NetWeaver Portal OnDevice - Consuming your SAP NetWeaver Portal On Mobile...
SAP NetWeaver Portal OnDevice - Consuming your SAP NetWeaver Portal On Mobile...
 
Optimizing HTML5 Sites with CQ5/WEM
Optimizing HTML5 Sites with CQ5/WEMOptimizing HTML5 Sites with CQ5/WEM
Optimizing HTML5 Sites with CQ5/WEM
 
3 12-2013 performance-testing_service_virtualization
3 12-2013 performance-testing_service_virtualization3 12-2013 performance-testing_service_virtualization
3 12-2013 performance-testing_service_virtualization
 
Cloud Computing & Scaling Web Apps
Cloud Computing & Scaling Web AppsCloud Computing & Scaling Web Apps
Cloud Computing & Scaling Web Apps
 
Aras PLM Roadmap
Aras PLM RoadmapAras PLM Roadmap
Aras PLM Roadmap
 
Standard Issue: Preparing for the Future of Data Management
Standard Issue: Preparing for the Future of Data ManagementStandard Issue: Preparing for the Future of Data Management
Standard Issue: Preparing for the Future of Data Management
 
Building an IaaS cloud
Building an IaaS cloudBuilding an IaaS cloud
Building an IaaS cloud
 
UI innovation with SAP NetWeaver Gateway
UI innovation with SAP NetWeaver GatewayUI innovation with SAP NetWeaver Gateway
UI innovation with SAP NetWeaver Gateway
 
WebLogic 12c Developer Deep Dive at Oracle Develop India 2012
WebLogic 12c Developer Deep Dive at Oracle Develop India 2012WebLogic 12c Developer Deep Dive at Oracle Develop India 2012
WebLogic 12c Developer Deep Dive at Oracle Develop India 2012
 
SAP on AWS
SAP on AWSSAP on AWS
SAP on AWS
 
Open_unified_dataprotection_framework
Open_unified_dataprotection_frameworkOpen_unified_dataprotection_framework
Open_unified_dataprotection_framework
 
Automating Security for the Cloud - Make it Easy, Make it Safe
Automating Security for the Cloud - Make it Easy, Make it SafeAutomating Security for the Cloud - Make it Easy, Make it Safe
Automating Security for the Cloud - Make it Easy, Make it Safe
 
The spring 32 update final
The spring 32 update finalThe spring 32 update final
The spring 32 update final
 
Cloud foundry elastic architecture and deploy based on openstack
Cloud foundry elastic architecture and deploy based on openstackCloud foundry elastic architecture and deploy based on openstack
Cloud foundry elastic architecture and deploy based on openstack
 
Leveraging The Clouds For Reliable Web Applications Presentation
Leveraging The Clouds For Reliable Web Applications PresentationLeveraging The Clouds For Reliable Web Applications Presentation
Leveraging The Clouds For Reliable Web Applications Presentation
 
Self-Service Access and Exploration of Big Data
Self-Service Access and Exploration of Big DataSelf-Service Access and Exploration of Big Data
Self-Service Access and Exploration of Big Data
 
14h00 aws deck-summit2012_sap_on_aws_s_jones_final
14h00   aws deck-summit2012_sap_on_aws_s_jones_final14h00   aws deck-summit2012_sap_on_aws_s_jones_final
14h00 aws deck-summit2012_sap_on_aws_s_jones_final
 
Virtualizing Latency Sensitive Workloads and vFabric GemFire
Virtualizing Latency Sensitive Workloads and vFabric GemFireVirtualizing Latency Sensitive Workloads and vFabric GemFire
Virtualizing Latency Sensitive Workloads and vFabric GemFire
 

Spring Data for JJUG for Cross Conference Fall

  • 1. クラウド時代のSpring Frameworkの新たな試み
 ~Spring Dataの全貌~ 2012年11月10日 ヴイエムウェア株式会社 クラウドアプリケーションプラットフォーム テクニカル・エバンジェリスト 池田 俊彦 © 2011 VMware Inc. All rights reserved
  • 2. ⾃自⼰己紹介 池⽥田俊彦 twitter:tikeda123 VMware  Cloud  Foundry,Spring関連の エバンジェリストとして活動
  • 3. Agenda •  はじめに •  Spring  Dataとは? • Spring  Data  Overview • リポジトリ • ドメインマッピング • テンプレート •  まとめ   3 Copyright © 2012 VMware, Inc. All rights reserved. This product is protected by U.S. and international copyright and intellectual property laws. VMware products are covered by one or more patents listed at http://www.vmware.com/go/patents .
  • 4. DataBase  スケールアウトオプション      Database Scaling options Centralized Relational Datastore Federated (NoSQL) Data Store 4 Copyright © 2012 VMware, Inc. All rights reserved. This product is protected by U.S. and international copyright and intellectual property laws. VMware products are covered by one or more patents listed at http://www.vmware.com/go/patents .
  • 5. Hard  to  create  a  “one  size  fits  all”  solution Fast  Data §  アクセス・パターンの多様化 §  モバイル・アプリの急増 Big  Data Flexible  Data §  ペタバイト  vs.   §  ⾮非構造化データ ギガバイト §  開発者の⽣生産性 §  BIの⼤大衆化 Cloud §  仮想化 §  “-‐‑‒as-‐‑‒a-‐‑‒Service”として 5 Copyright © 2012 VMware, Inc. All rights reserved. This product is protected by U.S. and international copyright and intellectual property laws. VMware products are covered by one or more patents listed at http://www.vmware.com/go/patents .
  • 6. Spring  Data  Overview  Spring  Dataプロジェクトは複数のサブプロジェクトから構成される。 Spring  Data  プロジェクト Document Graph Relational  Databases Data  Grid    Stores  Stores JPA JDBC   GemFire MongoDB Neo4J Extensions 6 Copyright © 2012 VMware, Inc. All rights reserved. This product is protected by U.S. and international copyright and intellectual property laws. VMware products are covered by one or more patents listed at http://www.vmware.com/go/patents .
  • 7. Spring  Data  Overview   “Spring  Data  provides  a  familiar  and  consistent   Spring-‐‑‒base  programming  model  for  NoSQL   and  relational  store  while  retaining  store-‐‑‒specific   features  and  capabilities.  “ …慣れ親しんだ⼀一貫したSpringベースのプログラミングモデ ル… 7 Copyright © 2012 VMware, Inc. All rights reserved. This product is protected by U.S. and international copyright and intellectual property laws. VMware products are covered by one or more patents listed at http://www.vmware.com/go/patents .
  • 8. Spring  Data  Overview  …慣れ親しんだ⼀一貫したSpringベースのプログラミングモデ ル… ? ? ? ? 8 Copyright © 2012 VMware, Inc. All rights reserved. This product is protected by U.S. and international copyright and intellectual property laws. VMware products are covered by one or more patents listed at http://www.vmware.com/go/patents .
  • 9. Spring  Data  Overview  Spring  Framework  の特徴 p Dependency  Injection ü 依存性の注⼊入:DI p Aspect-‐‑‒Oriented  Programming ü アスペクト志向プログラミング:AOP p Portable  Service  Abstraction ü データ永続化、スケジュール、トランザクショ ンに関する実装とビジネスロジックを疎結合にす るための抽象化 Simple Object Portable Service Abstraction 9 Copyright © 2012 VMware, Inc. All rights reserved. This product is protected by U.S. and international copyright and intellectual property laws. VMware products are covered by one or more patents listed at http://www.vmware.com/go/patents .
  • 10. Spring  Data  Overview Spring  Framework  の特徴  DI  (Dependency  Injection) AOP  (Aspect-‐‑‒Oriented  Programming) Portable  Service  Abstraction Springの特徴を活かした Spring  Data ⼀一貫したプログラムモデルの提供 POJOセントリックなデータアクセスモデル リポジトリ ドメイン・マッピング テンプレート 10 Copyright © 2012 VMware, Inc. All rights reserved. This product is protected by U.S. and international copyright and intellectual property laws. VMware products are covered by one or more patents listed at http://www.vmware.com/go/patents .
  • 12. 今までのデータアクセスアーキテクチャ  UI Controller Domain  objects Data  Access  (Hibernate,JPA,etc.) SQL DB 12 Copyright © 2012 VMware, Inc. All rights reserved. This product is protected by U.S. and international copyright and intellectual property laws. VMware products are covered by one or more patents listed at http://www.vmware.com/go/patents .
  • 13. 今までのデータアクセスアーキテクチャ  UI Controller Domain  objects Data  Access  (Hibernate,JPA,etc.) Relational 13 Copyright © 2012 VMware, Inc. All rights reserved. This product is protected by U.S. and international copyright and intellectual property laws. VMware products are covered by one or more patents listed at http://www.vmware.com/go/patents .
  • 14. 複雑でヘテロなデータアクセスアーキテクチャ   UI Controller Domain  objects Data  Access GemFire JPA MongoDB Neo4J Relational 14 Copyright © 2012 VMware, Inc. All rights reserved. This product is protected by U.S. and international copyright and intellectual property laws. VMware products are covered by one or more patents listed at http://www.vmware.com/go/patents .
  • 15. シンプルで統⼀一感のあるデータアクセスアーキテクチャ   UI Controller Domain  objects Spring  Data  Repository Relational 15 Copyright © 2012 VMware, Inc. All rights reserved. This product is protected by U.S. and international copyright and intellectual property laws. VMware products are covered by one or more patents listed at http://www.vmware.com/go/patents .
  • 16. リポジトリ “Mediates between the domain and data mapping layers using a collection-like interface for accessing domain objects.” http://martinfowler.com/eaaCatalog/repository.html 「ドメインドオブジェクトをアクセスするインタフェース群を使い、ドメ インレイヤとデータマッピングレイヤを仲介する。」 http://msdn.microsoft.com/en-us/library/ff649690.aspx
  • 17. Spring  Data  Repository  RDMとNoSQL共通したインタフェースを提供 Repository public interface Repository<T, ID extends Serializable >{ ……. } ドメインオブジェクトに対する基本インタフェース CrudRepository public interface CrudRepository<T, ID extends Serializable > extends Repository<T, ID> { ……. } ドメインオブジェクトに対するCRUD(Create-‐‑‒Read-‐‑‒Update-‐‑‒Delete  )操作を⾏行行うインタフェース PagingAndSortingRepository public interface PagingAndSoringRepository<T, ID extends Serializable > extends CrudRepository<T, ID> { ……. } ドメインオブジェクトに対するソート処理理やページ付け処理理操作を⾏行行うインタフェース 17 Copyright © 2012 VMware, Inc. All rights reserved. This product is protected by U.S. and international copyright and intellectual property laws. VMware products are covered by one or more patents listed at http://www.vmware.com/go/patents .
  • 18. Spring  Data  Repository  今までの(JPAのみ)アプローチ public interface CustomerRepository { Customer save(Customer account); Customer findByEmailAddress(EmailAddress emailAddress); } @Repository @Transactional(readOnly = true) class JpaCustomerRepository implements CustomerRepository {    @PersistenceContext    private EntityManager em;    @Override    @Transactional    public Customer save(Customer customer) {       if (customer.getId() == null) {        em.persist(customer);        return customer; } else {        return em.merge(customer);     }    } @Override public Customer findByEmailAddress(EmailAddress emailAddress) { TypedQuery<Customer> query = em.createQuery( "select c from Customer c where c.emailAddress = :emailAddress", Customer.class); query.setParameter("emailAddress", emailAddress); return query.getSingleResult(); } } 18 Copyright © 2012 VMware, Inc. All rights reserved. This product is protected by U.S. and international copyright and intellectual property laws. VMware products are covered by one or more patents listed at http://www.vmware.com/go/patents .
  • 19. Spring  Data  Repository  Spring  Dataを使ったアプローチ public interface CustomerRepository extends Repository<Customer Long>{        @Transaction(timeout = 60) Customer save(Customer account); Customer findByEmailAddress(EmailAddress emailAddress); } インタフェースに使いたいメソッドを定義するだけ。トランザクションを指定する場合は、@Transaction を記述する。 19 Copyright © 2012 VMware, Inc. All rights reserved. This product is protected by U.S. and international copyright and intellectual property laws. VMware products are covered by one or more patents listed at http://www.vmware.com/go/patents .
  • 20. “naming  conventions”  によるクエリメソッドの定義   public interface PagingAndSoringRepository<T, ID extends Serializable > extends CrudRepository<T, ID> { Iterable<T> findAll(Sort sort); Page<T> findAll(Pageable pageable); } public interface PersonRepository extends CrudRepository<Person, BigInteger> {     // Finder for a single entity    Person findByEmailAddress(String emailAddress);    // Finder for a multiple entities    List<Person> findByLastnameLike(String lastName);    // Finder with pagination    Page<Person> findByFirstnameLike(String firstName, Pageable page); } 20 Copyright © 2012 VMware, Inc. All rights reserved. This product is protected by U.S. and international copyright and intellectual property laws. VMware products are covered by one or more patents listed at http://www.vmware.com/go/patents .
  • 21. Spring  Data  Repository    クエリー JPA  クエリメソッド(Naming  convertions  ベース) •  Query  annotation  でオーバーライド可能 •  JPA  named  query  (@NamedQuery)  の参照も可 •  JPAの場合、JPQLをアノテーションにより記述、MongoDB(GeoSptialも対応),Neo4(cypher) も同様に対応可能。 public interface PersonRepository extends CrudRepository<Person,BigInteger> { // previous methods omitted... @Query("select p from Person p where p.emailAddress = ?1”) Person findByEmailAddress(String emailAddress); @Query("select p from Person p where p.firstname = :firstname or p.lastname = :lastname") Person findByLastnameOrFirstname( @Param("lastname") String lastname, @Param("firstname") String firstname); } 21 Copyright © 2012 VMware, Inc. All rights reserved. This product is protected by U.S. and international copyright and intellectual property laws. VMware products are covered by one or more patents listed at http://www.vmware.com/go/patents .
  • 22. Spring  Data  Repository  Spring  Data  Repository設定 xml  namespaceによる定義 <?xml version="1.0" encoding="UTF-8"?> <beans:beans xmlns:beans="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance” ……. http://www.springframework.org/schema/data/jpa/spring-jpa.xsd"> <jpa:repositories base-package="com.acme.**.repository" /> </beans> 上記はJPAの例例、mongodbの場合は<mongo:repositories…/>、neo4jの場合は <neo4j:repositories…/> JavaConfigによる定義 @Configuration @EnableJpaRepositories class ApplicationConfig { } 上記はJPAの例例、mongodbの場合は@EnableMongoRepositories、neo4jの場合は @EnableNeo4jRepositories 22 Copyright © 2012 VMware, Inc. All rights reserved. This product is protected by U.S. and international copyright and intellectual property laws. VMware products are covered by one or more patents listed at http://www.vmware.com/go/patents .
  • 23. Spring  Data  Repository  Spring  Data  Repositoryの使い⽅方 CrudRepositoryインタフェースの拡張及びQueryメソッドの定義 public interface ProductRepository extends CrudRepository<Product, Long> { Page<Product> findByDescriptionContaining(String description, Pageable pageable); @Query("select p from Product p where p.attributes[?1] = ?2") List<Product> findByAttributeAndValue(String attribute, String value); } @Autowired ProductRepository repository; @Test public void lookupProductsByDescription() {    Pageable pageable = new PageRequest(0, 1, Direction.DESC, "name");    Page<Product> page = repository.findByDescriptionContaining("Apple", pageable);    assertThat(page.getContent(), hasSize(1));    assertThat(page, Matchers.<Product> hasItems(named(“iPad”)));           …… } 23 Copyright © 2012 VMware, Inc. All rights reserved. This product is protected by U.S. and international copyright and intellectual property laws. VMware products are covered by one or more patents listed at http://www.vmware.com/go/patents .
  • 24. Spring  Data  Repository  メリット 共通(SQL,NoSQL)のインタフェースとして利利⽤用 “boiler-‐‑‒plate  code(お決まりごとのコード)”の排除 クエリをアノテーションを使って簡単にアノテーションメソ ッドとして定義 24 Copyright © 2012 VMware, Inc. All rights reserved. This product is protected by U.S. and international copyright and intellectual property laws. VMware products are covered by one or more patents listed at http://www.vmware.com/go/patents .
  • 25. ドメイン・マッピング 25 Copyright © 2012 VMware, Inc. All rights reserved. This product is protected by U.S. and international copyright and intellectual property laws. VMware products are covered by one or more patents listed at http://www.vmware.com/go/patents .
  • 26. ドメイン・マッピング Javaのオブジェクトをそれぞれのデータストアのデータ構造にマッピング ただし、データ構造が違うので、共通したインタフェースは持てない。 public  class  Person{        private  BigInteger    id;        private  String  firstname,  lastname;        private  EmailAddress  emailAdress;        …….. }   マッピング Relational 26 Copyright © 2012 VMware, Inc. All rights reserved. This product is protected by U.S. and international copyright and intellectual property laws. VMware products are covered by one or more patents listed at http://www.vmware.com/go/patents .
  • 27. ドメイン・マッピング      リレーショナルDB(JPA) PERSON @Entity Id fname lname (INTEGAR) (VARCHAR) (VARCHAR) @Table(name=”CPERSON”) public class Person{ @Id private int Id; O/R マッピング @Column(name=“fname”) ADDRESS city street private String Firstname; (VARCHAR) (VARCHAR) @Column(name=“lname”) private String Lastname; @OneToMany private List Addres; } 27 Copyright © 2012 VMware, Inc. All rights reserved. This product is protected by U.S. and international copyright and intellectual property laws. VMware products are covered by one or more patents listed at http://www.vmware.com/go/patents .
  • 28. ドメイン・マッピング    ドキュメントタイプ(MongoDB) @Document( collection=”CPERSON”) public class Person{ { Id:”100” fname : ”Toshihiko", @Id lname : ”Ikeda", private int Id; addresses : [ {city : ”Musashino", マッピング street : ”yamanote-3-2-6" } ] } @Field(“fname”) private String Firstname; @Field(“lname”) private String Lastname; private List Address; } 28 Copyright © 2012 VMware, Inc. All rights reserved. This product is protected by U.S. and international copyright and intellectual property laws. VMware products are covered by one or more patents listed at http://www.vmware.com/go/patents .
  • 29. ドメイン・マッピング    ドキュメントタイプ   Spring  Dataを使わないケース(マッピングコードを⾃自分で書いた場合) public void mongoBasic() throws Exception { Mongo mongo = new Mongo(); DB db = mongo.getDB("database"); DBCollection customers = db.getCollection("customers"); DBObject address = new BasicDBObject("city", ”Kobe"); address.put("street", "Broadway"); DBObject addresses = new BasicDBList(); ((BasicDBList) addresses).add(address); DBObject customer = new BasicDBObject("firstname", "Tsuyoshi"); customer.put("lastname", "Miyake"); ustomer.put("addresses", addresses); customers.insert(customer); System.out.println(customers.findOne()); } Insert  /  Updateに対するコードなど •  (全ての)アプリケーション  POJO  -‐‑‒>  DBObject  にマップする必要あり   •  mongo.getDatabase(...).getCollection(...).insert(...)。 29 Copyright © 2012 VMware, Inc. All rights reserved. This product is protected by U.S. and international copyright and intellectual property laws. VMware products are covered by one or more patents listed at http://www.vmware.com/go/patents .
  • 30. ドメイン・マッピング  グラフDB @NodeEntity firstname : Mike public class Person{ @GraphId Person private int Id; マッピング Address : private String Firstname; firstname : Midori-cho firstname : private String Lastname; Toshihiko John @RelatedTo(type = ”ADDRESS", direction = Direction.OUTGOING) private List Address; } 30 Copyright © 2012 VMware, Inc. All rights reserved. This product is protected by U.S. and international copyright and intellectual property laws. VMware products are covered by one or more patents listed at http://www.vmware.com/go/patents .
  • 31. ドメイン・マッピング    グラフDB   Spring  Dataを使わないケース(マッピングコードを⾃自分で書いた場合) public class Person { private final Node underlyingNode; public Person(final Node node) { underlyingNode = node; } public Node getUnderlyingNode() { return underlyingNode; } public final String getName() { return (String) underlyingNode.getProperty(“name”); } public void setName(final String name) { underlyingNode.setProperty(“name”, name); } } TypeSafeでない記述  underlyingNode.getProperty(“name”); 31 Copyright © 2012 VMware, Inc. All rights reserved. This product is protected by U.S. and international copyright and intellectual property laws. VMware products are covered by one or more patents listed at http://www.vmware.com/go/patents .
  • 32. ドメイン・マッピング  メリット POJOセントリックなプログラミングが可能 データ構造が違うので、共通したインタフェースは持てないが アノテーションを使ってデータストアの特質を表現 32 Copyright © 2012 VMware, Inc. All rights reserved. This product is protected by U.S. and international copyright and intellectual property laws. VMware products are covered by one or more patents listed at http://www.vmware.com/go/patents .
  • 33. テンプレート 33 Copyright © 2012 VMware, Inc. All rights reserved. This product is protected by U.S. and international copyright and intellectual property laws. VMware products are covered by one or more patents listed at http://www.vmware.com/go/patents .
  • 34. テンプレート 低レイヤの例例外処理理、リソース管理理に煩わすことなく、 Exception 実装に専念念できる。 Translation ドライバ実装によって例外ハンドリングが違う。 Spring  Data  Repository 例外を受け取り、開発者へ適切に再スロー JPA MongoTemplate Neo4jTemplate MongoDB driver Neo4J driver リソースマネジメント 適切なリソースの確保、リソースの解放 Relational 34 Copyright © 2012 VMware, Inc. All rights reserved. This product is protected by U.S. and international copyright and intellectual property laws. VMware products are covered by one or more patents listed at http://www.vmware.com/go/patents .
  • 35. まとめ 慣れ親しんだ⼀一貫したSpringベースのプログラミングモデル提供 Springの特徴を活かしたPOJOセントリックなデータアクセスモデル メリット •  共通(SQL,NoSQL)のインタフェースとして利利⽤用 •  “boiler-‐‑‒plate  code(お決まりごとのコード)”の排除 リポジトリ •  クエリをアノテーションを使って簡単にアノテーションメ ソッドとして定義 •  POJOセントリックなプログラミングが可能 ドメイン・マッピング •  データ構造が違うので、共通したインタフェースは持てな いがアノテーションを使ってデータストアの特質を表現 •  低レイヤの例例外処理理、リソース管理理に煩わすことなく、実 テンプレート 装に専念念できる。 35 Copyright © 2012 VMware, Inc. All rights reserved. This product is protected by U.S. and international copyright and intellectual property laws. VMware products are covered by one or more patents listed at http://www.vmware.com/go/patents .
  • 36. Spring  Dataコアエンジニアの来⽇日決定 12/9    18:00〜~21:00   VMware  浜松町オフィス Spring  Dataの神髄を語る 参加希望者は、以下のURLから登録ください。 http://atnd.org/events/34055 Engineer at SpringSource Oliver Gierke is engineer at SpringSource, a division of VMware, project lead of the Spring Data JPA module and involved into other Spring Data modules (e.g. MongoDB) as well. He has been into developing enterprise applications and open source projects for over 6 years now. His working focus is centered around software architecture, Spring and persistence technologies. He is regularly speaking at German and international conferences as well as author of technology articles. Oliver Gierke 36 Copyright © 2012 VMware, Inc. All rights reserved. This product is protected by U.S. and international copyright and intellectual property laws. VMware products are covered by one or more patents listed at http://www.vmware.com/go/patents .