Implementing Generic Interfaces and inheritance
<p>Trying to implement a generic and inheritance classes in a Java Project.
For that reason I created the "Base" classes and Interfaces that will inheritance all the specific classes and interfaces.</p>

<p>I mean, I have a Base Interface</p>

<pre><code>public interface BaseServices&lt;T&gt; {
    public boolean validate(T item, int id) throws Exception;
}
</code></pre>

<p>And a Base Implementation for that Interface</p>

<pre><code>public class BaseServicesImpl implements BaseServices&lt;BaseBO&gt; {

@Autowired
BaseDao dao;
CategoryBO bo;

public BaseServicesImpl()
{
    this.bo = new CategoryBO();
}

    @Override
       public boolean validate(BaseBO item, int id) throws Exception {
       return dao.validate("name",item.toString(), id);
    } 
}
</code></pre>

<p>Where BaseBO is the business object that ALL the other objects will extend.</p>

<p>And then, for an specific object, I will have a particular Interface which extends the Base one.</p>

<pre><code>public interface CategoryServices extends BaseServices {
    }
</code></pre>

<p>And its implementation:</p>

<pre><code>public class CategoryServicesImpl extends BaseServicesImpl implements CategoryServices&lt;CategoryBO&gt; {

    @Autowired
    CategoryDao categoryDao;

    public CategoryServicesImpl()
    {
        this.dao = categoryDao;
    }

    @Override
    public boolean validate(CategoryBO item, int id) throws Exception {
            return dao.validate("name",item.getName(), id);
    }
}
</code></pre>

<p>Where some object can implement the generic "Validate" method (which validates just the name) or extend it to what the class requiredpublic class CategoryServicesImpl extends BaseServicesImpl implements CategoryServices.</p>

<p>How can I make this work? Is it possible? I'm trying to do the most I can to reuse my code. Let me know if there is another way.</p>

<p>EDITED:
What I'm trying to do, is to have a base class with all the common method for all the classes, let say, the basic for create, edit, delete, get, getAll, etc. And then in each class I also can have and override for those method because in some classes they will be different, but in most, they will just do the same so it will call the generic ones that were defined in Base class.</p>