Ignore:
Timestamp:
Mar 29, 2011, 8:21:25 PM (13 years ago)
Author:
mlg
Message:

Complete rewriting of the api
The api now uses interfaces everywhere (for the dao, services and session manager). This allows the developer to use his own implementations if he wants.
Deletion of the singletons. There are now getters and setters. It allows to make dependency injection.
Use of sl4j in the api, instead of using log4j.

Location:
extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/dao/impl
Files:
1 added
1 copied

Legend:

Unmodified
Added
Removed
  • extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/dao/impl/TagDaoImpl.java

    r9902 r9919  
    1 package fr.mael.jiwigo.dao;
     1package fr.mael.jiwigo.dao.impl;
    22
    33import java.io.IOException;
     
    55import java.util.List;
    66
     7import org.slf4j.Logger;
     8import org.slf4j.LoggerFactory;
    79import org.w3c.dom.Document;
    810import org.w3c.dom.Element;
     
    1012import org.w3c.dom.NodeList;
    1113
     14import fr.mael.jiwigo.dao.TagDao;
    1215import fr.mael.jiwigo.om.Image;
    1316import fr.mael.jiwigo.om.Tag;
     
    3538 *
    3639 */
    37 public class TagDao {
     40public class TagDaoImpl implements TagDao {
    3841    /**
    3942     * Logger
    4043     */
    41     public static final org.apache.commons.logging.Log LOG = org.apache.commons.logging.LogFactory.getLog(TagDao.class);
    42     /**
    43      * Instance, to use a singleton
    44      */
    45     private static TagDao instance;
     44    private final Logger LOG = LoggerFactory.getLogger(ImageDaoImpl.class);
    4645
    4746    private SessionManager sessionManager;
    48 
    49     /**
    50      * private constructor to use a singleton
    51      */
    52     private TagDao(SessionManager sessionManager) {
    53         this.sessionManager = sessionManager;
    54     }
    55 
    56     /**
    57      * @return the instance
    58      */
    59     public static TagDao getInstance(SessionManager sessionManager) {
    60         if (instance == null) {
    61             instance = new TagDao(sessionManager);
    62         }
    63         return instance;
    64     }
    6547
    6648    /**
     
    135117    }
    136118
     119    public SessionManager getSessionManager() {
     120        return sessionManager;
     121    }
     122
     123    public void setSessionManager(SessionManager sessionManager) {
     124        this.sessionManager = sessionManager;
     125    }
     126
    137127}
Note: See TracChangeset for help on using the changeset viewer.