ibatis-user-cs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nguyen, Tom" <Tom.Ngu...@rels.info>
Subject RE: Hey Guys - Another IBatisNet Demo App for VS.NET2005
Date Sat, 27 May 2006 19:38:22 GMT
Thank you for the feedback.

I understand what you are saying and we all agree that it's better not
to build sqlMapper every time you need to use it.  We can also use
Singleton pattern as suggested in IBatisNet help file to simplify the
code even further.  

In writing the presentation, I have to keep in mind that my co-worker,
Team Leads, and IT Director are complete newbees to IBatisNet.  Showing
them how to configure the sqlMapper inside the Select method allows me
to perform line by line walkthrough of the complete process of setting
up the sqlMapper and using it.

If you look at the demo code inside Rels.Blogs.BusinessObjects -
Blog_DataAccess.cs, I did exactly that.  I showed it to some of my team
members before the actual presentation and there were a lot of
confusions.  The code was:

SqlMapperConfig.Instance.Map.QueryForObject<Blog>("Select", id);

One of the confusion was the audience assume that SqlMapperConfig was
part of IBatisNet which results in question like "Can you tell the
DataMapper to use another configuration file and how?"

As a result, I had to refactor my presentation to what it is now.  It's
funny that this sounds a lot like how we code, lots of refactoring.

Tom Nguyen
Sr. Developer
tom.nguyen@rels.info

-----Original Message-----
From: Ron Grabowski [mailto:rongrabowski@yahoo.com] 
Sent: Saturday, May 27, 2006 9:06 AM
To: user-cs@ibatis.apache.org
Subject: Re: Hey Guys - Another IBatisNet Demo App for VS.NET2005

Looks good. When you compare the ADO.Net code to the DataMapper, you
could use this snippet to really highlight how much less code the
DataMapper requires:

 public static Blog Select(int? id)
 {
  return sqlMapper.QueryForObject<Blog>("Blog.SelectById", id);
 }

I don't think its important you show people how to configure the
sqlMapper object inside the Select method. You might want to add
another slide showing the two or three lines of configuration as
belonging to Application_Start.

--- "Nguyen, Tom" <Tom.Nguyen@rels.info> wrote:

> I've been playing with IBatisNet for the last two weeks and I'm will
> be
> presenting it tomorrow to my Company.
> 
>  
> 
> Here is my PowerPoint presentation and sample application (it's not
> 100%
> complete but pretty much there).  It has been pretty rough trying to
> get
> everything together.  I thought I would share my presentation, if it
> helps make it easy for someone new to learn IBatisNet.
> 
>  
> 
> http://www.noogen.net/download/free/Blogs.zip
> 
>  
> 
> Here is what included in the .NET 2005 Test project.
> 
> 1.	Demonstrate using IBatisNet.DataMapper alone.
> 2.	Demonstrate using IBatisNet.DataAccess
> 3.	Demonstrate custom DataAccess implementing IBatisNet.DataMapper
> 4.	Demonstrate using Aspect# with IBatisNet (though the only thing
> I did was mark an object as a proxy using mixin - you review aspect#
> documentation to see how to setup interceptors/advices.)
> 5.	Demonstrate using multiple datasource - MS Access and SQL Server
> - Use schema.sql to create your sql server database and set
> connection
> string in sqlMap_sqlserver.config .
> 
>  
> 
> Thanks Gills and everyone for all your helps!
> 
>  
> 
> Note:  IBatsNet binaries were build using latest source from SVN, but
> you need to make 3 minor modifications to work with Aspect#
> 
>  
> 
> Sorry Gills, the last time I asked for this bug fix, I was in a hurry
> and had the logic reversed...
> 
>  
> 
> DotNetObjectDataExchange.cs line 81:
> 
> if (target.GetType() != _parameterClass 
> 
> && !(_parameterClass.IsSubClassOf(target.GetType())) )
> 
> Should be:
> 
>             if ( (target.GetType() != _parameterClass)
> 
>                 && !target.GetType().IsSubclassOf(_parameterClass))
> 
>  
> 
>  
> 
> And DlegatePropertyGetAccessor.cs( line 64 ) and
> DelegatePropertySetAccessor (line 65):
> 
> From: 
> 
>             PropertyInfo propertyInfo =
> _targetType.GetProperty(propertyName);
> 
>  
> 
> To: 
> 
>             PropertyInfo propertyInfo =
> _targetType.GetProperty(propertyName, BindingFlags.Public |
> BindingFlags.Instance | BindingFlags.DeclaredOnly);
> 
>  
> 
>             if (propertyInfo == null)
> 
>                 propertyInfo = _targetType.GetProperty(propertyName);
> 
>  
> 
> This has to do with ambiguous method exception when overriding a
> property with the new keyword:
> 
> Details:
> http://blogs.msdn.com/thottams/archive/2006/03/17/553376.aspx
> 
>  
> 
> Thanks,
> 
>  
> 
> Tom Nguyen
> 
> Sr. Developer
> 
> tom.nguyen@rels.info
> 
>  
> 
> 


Mime
View raw message