[ 
http://issues.apache.org/jira/browse/IBATISNET-74?page=comments#action_66414 ]
     
Roberto Rabe commented on IBATISNET-74:
---------------------------------------

So, just to be clear, the proposal for SqlMapper configuration is:

Relative Paths
--------------
SqlMapper.Configure("resource://sqlMap.Config")
SqlMapper.Configure("sqlMap.Config")
SqlMapper.ConfigureAndWatch("resource://sqlMap.Config")
SqlMapper.ConfigureAndWatch("sqlMap.Config")

Absolute Paths
--------------
SqlMapper.Configure("file://c:\MyDirectory\sqlMap.Config")
SqlMapper.Configure(FileInfo absolutePath)
SqlMapper.Configure(Uri location)  [should be absolute!]
SqlMapper.ConfigureAndWatch("file://c:\MyDirectory\sqlMap.Config")
SqlMapper.ConfigureAndWatch(FileInfo absolutePath)

Embedded
--------------
SqlMapper.Configure("embedded://A.B.SqlMap.Config, assemblyName")

Stream
--------------
SqlMapper.Configure(Stream resource)


Looking at that, I don't know if I'd want to mix protocols with "embedded://" 
and "resource://".  I agree with Ron.  It just doesn't fit cleanly.  The 
original proposal used "embedded:" and "resource:" and didn't have the other 
overloads.  

With all those overloads available, why can't Configure(string) and 
ConfigureAndWatch(string) just be for SqlMap.config filenames that are expected 
to be in the same app base (directory location) as the web.config or app.config 
file.  

The relative path in <sqlMap> seems to be confusing enough with the app base 
directory being different by project.   Now, a relative string path for the 
SqlMap.config could end up being hard-coded into the Configure() method call by 
alot of people and cause the same confusion if they deployed a DAL as a library 
that happened to be used for web, windows, and "test"/console apps.

> Improvement for configuration
> -----------------------------
>
>          Key: IBATISNET-74
>          URL: http://issues.apache.org/jira/browse/IBATISNET-74
>      Project: iBatis for .NET
>         Type: Improvement
>  Environment: .NET
>     Reporter: Gilles Bayon
>     Assignee: Gilles Bayon
>     Priority: Minor
>      Fix For: DataMapper 1.2

>
> To improve loading of sqlMap/dao.config files and make it more clearly, I 
> propose to use the same syntax as for other tag.
> Loading of sqlMap/dao.config files with relative path : 
> SqlMapper.Configure("resource:sqlMap.Config") or 
> SqlMapper.Configure("sqlMap.Config") [to keep old syntax][+ idem for 
> ConfigureAndWatch]
> Loading of sqlMap/dao.config files with absolute path : 
> SqlMapper.Configure("url:c:\MyDirectory\sqlMap.Config") [+ idem for 
> ConfigureAndWatch]
> Loading of sqlMap/dao.config files embedded : 
> SqlMapper.Configure("embedded:A.B.SqlMap.Config, assembyName") 
> [ConfigureAndWatch will not be allow]

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

Reply via email to