D
David
Hi all,
Part of my current project brief is to create certain things to be as
flexible as possible for new (unknown) projects down the line.
I have done quite a bit on the way...
For example, I was asked to be able to receive files by email (POP3 or
SMTP). This now (after a lot of struggling) works.
The email handler will then push the attached files to a web service. The
reason I have done it this way is that in the future, the email handler
could potentially be taken out of the equation and the sender connect
directly to the web service.
One of the files coming in is an XML file. Basically, to keep it as flexible
as possible, all I know about the XML is that it follows a set pattern, but
the contents will be variable (for example, in the current project, I can
receive 7 different patterns of xml. Imagine it as an excel sheet, with
different column names at the top)
So, as I know what each of the 7 patterns look like, I can create a mapping
to the database. The webservice knows nothing about the database and nothing
about the XML. I have a mapping (for each of the 7 patterns) file that
describes what database I need, what DB table I need, and what data in the
incoming XML maps to the fields in the table.
This works brilliantly and it means that any future project can use it with
no modification. All I have to do is create a mapping file. Another benefit
is that if the DB or the incoming XML changes, all I have to do is modify
the mapping file and not have to re-compile the application. (I have to use
SQL Client to connect tot he DB, as to work with Linq, I have to know the
table structure and of course, the webservice can't know the DB structure).
Anyhow, the problem I have is that some information that is required in the
table has to come from other areas of the database. For example, I have an
ID number come in the XML. This ID number belongs to a person, but is not
his ID in the database. However, the DB will know the ID as it is assigned
to that person. The problem is that this particular ID can be re-assigned at
any time.
So, my thoughts are to extend the DB tables (the ones I am mapping to) to
contain the persons DB ID rather than the incoming ID. However, as I don't
know the db structure from the webservice, I can't really collect it. So, my
thoughts are to some how have the web service have a hook of some sort into
a 'customer specific' function. The customer specific function will be
delivered as an add-on.
So, my web service should connect to the customer specific function to do
any jobs the customer requires to the data.
How should I write this connection? I want to somehow extend the generic web
service without the web service actually knowing what the customer function
does.
Thanks for any advice you can offer.
--
Best regards,
Dave Colliver.
http://www.AshfieldFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available
Part of my current project brief is to create certain things to be as
flexible as possible for new (unknown) projects down the line.
I have done quite a bit on the way...
For example, I was asked to be able to receive files by email (POP3 or
SMTP). This now (after a lot of struggling) works.
The email handler will then push the attached files to a web service. The
reason I have done it this way is that in the future, the email handler
could potentially be taken out of the equation and the sender connect
directly to the web service.
One of the files coming in is an XML file. Basically, to keep it as flexible
as possible, all I know about the XML is that it follows a set pattern, but
the contents will be variable (for example, in the current project, I can
receive 7 different patterns of xml. Imagine it as an excel sheet, with
different column names at the top)
So, as I know what each of the 7 patterns look like, I can create a mapping
to the database. The webservice knows nothing about the database and nothing
about the XML. I have a mapping (for each of the 7 patterns) file that
describes what database I need, what DB table I need, and what data in the
incoming XML maps to the fields in the table.
This works brilliantly and it means that any future project can use it with
no modification. All I have to do is create a mapping file. Another benefit
is that if the DB or the incoming XML changes, all I have to do is modify
the mapping file and not have to re-compile the application. (I have to use
SQL Client to connect tot he DB, as to work with Linq, I have to know the
table structure and of course, the webservice can't know the DB structure).
Anyhow, the problem I have is that some information that is required in the
table has to come from other areas of the database. For example, I have an
ID number come in the XML. This ID number belongs to a person, but is not
his ID in the database. However, the DB will know the ID as it is assigned
to that person. The problem is that this particular ID can be re-assigned at
any time.
So, my thoughts are to extend the DB tables (the ones I am mapping to) to
contain the persons DB ID rather than the incoming ID. However, as I don't
know the db structure from the webservice, I can't really collect it. So, my
thoughts are to some how have the web service have a hook of some sort into
a 'customer specific' function. The customer specific function will be
delivered as an add-on.
So, my web service should connect to the customer specific function to do
any jobs the customer requires to the data.
How should I write this connection? I want to somehow extend the generic web
service without the web service actually knowing what the customer function
does.
Thanks for any advice you can offer.
--
Best regards,
Dave Colliver.
http://www.AshfieldFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available