dbPortal

This forum is for questions about contributing to the project or proposing features that you would like to develop for the project. 

This thread is closed to new posts. You must sign in to post in the forums.
9/7/2007 5:01:20 AM
Gravatar
Total Posts 1

dbPortal

Hello Joe,

I think that dbPortal class is quite huge and there is a lot of chances to create hidden bugs. I think it is a problem mostly in parameter definitions.

So I have created a supporting class, which gives me the possibility to write code like this:

public static IDataReader SharedFile_GetSharedFilesByPage(int SiteID, int PageID)
{
    SqlParameterHelper sph = new SqlParameterHelper(GetConnectionString(), "mp_SharedFiles_SelectByPage", 2);
    sph.DefineSqlParameter("@SiteID", SqlDbType.Int, ParameterDirection.Input, SiteID);
    sph.DefineSqlParameter("@PageID", SqlDbType.Int, ParameterDirection.Input, PageID);
    return sph.ExecuteReader();
}

You can see that code is much more smaller. I have also added some asserts into new class, so it is providing basic checks for parameter names, types and directions (when using cached parameters).

Result of this change is decrease of code lines from 13000 to 4600.

Are you interested in such a change? I have changed already my MSSQL dbPortal (latest version).

Petr Kures

9/7/2007 5:14:07 AM
Gravatar
Total Posts 18439

Re: dbPortal

Hi Petr,

Yes, I'd be interested. Are you working from svn trunk? Can you create a patch file for dbPortal against svn trunk and send me a zip of any new files for the helper?

Thanks,

Joe

joe dot audette at gmail dot com

You must sign in to post in the forums. This thread is closed to new posts.