/*
 * Created on 2005-12-19
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
package org.huihoo.jfox.soaf.samples.struts.service;

import java.util.Collection;

import org.huihoo.jfox.soaf.samples.struts.dao.CheeseDao;
import org.huihoo.jfox.soaf.samples.struts.model.Cheese;

/**
 * @author peter
 * 
 * TODO To change the template for this generated type comment go to Window -
 * Preferences - Java - Code Style - Code Templates
 */
public class CheeseServiceImpl implements CheeseService {

	private final CheeseDao dao;

	public CheeseServiceImpl(CheeseDao dao) {
		this.dao = dao;
	}

	public Collection getCheeses() {
		return dao.all();
	}

	public Cheese find(Cheese example) {
		return dao.get(example.getName());
	}

	public void save(Cheese cheese) {
		dao.save(cheese);
	}

	public void remove(Cheese cheese) {
		dao.remove(cheese);
	}

}