So, I have the basics of an XML parser completed, now I need to implement this to deliver what I am wanting, which is the Java OData Consuming Utility. I am going to work on the loosely typed or underived version first, then I will implement the derived version.
Briefly, lets look at the functionality we can expect from the repository.
string GetSource() / SetSource(string)
This will define what the source of the oData is.bool GetMetadataRequired() / void SetMetadataRequired(bool)
This will set or get if the metadata is required for this repositoryODataEntities Fetch()
This will get the entities from the oData queryIODataQuery Filter(string)
Applies the filter URI convention to the sourceIODataQuery SetEntityCollection(string)
This will define which collection that it is desired to getIODataQuery GetEntity(string)
Gets a single entity from the collectionIODataQuery SetOrderBy(string)
Sets what the list is ordered byIODataQuery Top(string)
Sets the number of entities that we want returnedIODataQuery Expand(string)
Sets which related entities to expandIODataQuery Format(string)
Sets the format to return the data in (not used really for what I want, should I scrap it?)IODataQuery Select(string)
Identifies which entity items to select, and related itemsIODataQuery InlineCount(string)
Sets the inline count property on the data sourceIODataQuery CustomURIElement(string)
Sets a custom element to the query that is sent to the OData sourcestring GetMetadata(string)
This will get the OData collection metadata entry
And, from the point of view of the entity we have the following:
string Get(string)
Gets the value of the key passed thoughstring GetMetadata(string)
Gets the metadata value for the key passed though
Most of this is derived from the OData URI conventions, with some basic access functions thrown in. I think that this is all I need to implement, but to be honest I’m not sure. I have a feeling I will be uncovering more than I expect as I start to tackle the implementation of the repository access, but I need to start somewhere, and this is the best place. I am aiming to finish this off in the next month or so, but as I am doing this in my spare time to have some fun we shall see what happens.