S
Schemed
Hello,
I spent yesterday trying to figure this out to no avail. It appears
to be a no brainer case for generics but so far I am stuck having to
pass values as an object type.
I have four Assemblies.
1.) BookDatabase :
- database tier
- Implements Abstract BookProvider
2.) BookObject :
- Implements Interface IBookObj
3.) SearchEngine/Indexer (Lucene) :
- Implements Interface ISearchEngine
4.) ProviderObj :
- Declares interface and abstract object
- Plumbs the above three assemblies togethor
- ie.
namespace ProviderObj
{
public abstract class BookProviderAbstract : ProviderBase
{
public abstract object[] GetBookIds(int startRowIndex,
int maxRows);
public abstract void LoadBooks(IBookObj[] Books,
object[] BookIds);
:
:
:
}
public interface IBookObj
{
object ID
{
get;
set;
}
:
:
:
}
public interface ISearchEngine
{
object[] GetBookIDsAuthoredBy(string Author)
:
:
:
}
}
I would like to be able to use generics for the ID object
(IBookObj.ID). The ID object type would be defined in Assembly 2 -
the BookObject.
Any help would be tremendously appreciated.
I spent yesterday trying to figure this out to no avail. It appears
to be a no brainer case for generics but so far I am stuck having to
pass values as an object type.
I have four Assemblies.
1.) BookDatabase :
- database tier
- Implements Abstract BookProvider
2.) BookObject :
- Implements Interface IBookObj
3.) SearchEngine/Indexer (Lucene) :
- Implements Interface ISearchEngine
4.) ProviderObj :
- Declares interface and abstract object
- Plumbs the above three assemblies togethor
- ie.
namespace ProviderObj
{
public abstract class BookProviderAbstract : ProviderBase
{
public abstract object[] GetBookIds(int startRowIndex,
int maxRows);
public abstract void LoadBooks(IBookObj[] Books,
object[] BookIds);
:
:
:
}
public interface IBookObj
{
object ID
{
get;
set;
}
:
:
:
}
public interface ISearchEngine
{
object[] GetBookIDsAuthoredBy(string Author)
:
:
:
}
}
I would like to be able to use generics for the ID object
(IBookObj.ID). The ID object type would be defined in Assembly 2 -
the BookObject.
Any help would be tremendously appreciated.