1 / 14

Easy Database Access with SubSonic

Michael Paladino Lead Application Developer EagleOne. Easy Database Access with SubSonic. Who am I?. Lead Application Developer at EagleOne Experience and interests: Classic ASP .NET SQL Server Content Management Systems Open source software FSDNUG!. Outline.

azana
Télécharger la présentation

Easy Database Access with SubSonic

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Michael Paladino Lead Application Developer EagleOne Easy Database Access with SubSonic

  2. Who am I? • Lead Application Developer at EagleOne • Experience and interests: • Classic ASP • .NET • SQL Server • Content Management Systems • Open source software • FSDNUG!

  3. Outline • Problems with standard ADO.NET data access • What is ORM? • What is SubSonic? • Setup • Basics • Web Form Controls • Other SubSonic Goodness • Summary / Resources

  4. Problems with standard ADO.NET data access • Demo 1: Data access in code-behind • Requires duplication • Lots of hand-coding • No compile-time checking • Demo 2: Custom objects • Lots of hand-coding • No compile-time checking

  5. What is ORM? • Object-Relational Mapping • Wikipedia: • “…programming technique for converting data between incompatible type systems in relational databases and object-oriented programming languages.” • Typically automated • Example .NET Implementations: • NHibernate • Wilson’s O/R Mapper • ADO.NET Entity Framework • LINQ to SQL

  6. What is SubSonic? • ORM tool – Provides .NET objects that allow access to the underlying database. • Designed for web development but can be used in Windows Forms apps • Collection of web forms controls to speed up web development • Provides ability to track database changes • Supports SQL Server 2000 and 2005, MySQL, Oracle (SQLLite, SQLCE, PostGres coming soon) • Open Source

  7. Setup • One-Time • Download and install release 2.0.3 • Setup toolbar buttons in Visual Studio • Add controls to Visual Studio toolbox • Per-Project • Add reference to SubSonic.dll • Update Web.config • Create _DB and _Generated folders

  8. Demo App • Basic blog engine • Multiple authors, only one per post • Multiple categories per post • Comments • Simple editing • Database structure • SubSonic conventions

  9. SubSonic Basics • ActiveRecord pattern • Working with single objects • ViewPost.aspx • Working with collections • Default.aspx • Add comments to ViewPost.aspx • Updating and deleting • EditPost.aspx

  10. Web Forms Controls • Calendar Control – EditPost.aspx • Radio Buttons – EditPost.aspx • Dropdown – EditPost.aspx • ManyManyList – EditPost.aspx • Scaffold – Scaffold.aspx • Auto Scaffolding – AutoScaffolding.aspx • QuickTable – Sandbox.aspx

  11. Other SubSonic Goodness • Views – Sandbox.aspx • Stored Procedures – Sandbox.aspx • Query Tool – Sandbox.aspx • Partial Classes – Comment.vb • “Sugar” – Sandbox.aspx • DB Versioning • Template Customization

  12. Summary • SubSonic has the potential to greatly speed up database-driven web development • Future possibilities?

  13. Resources • Main Site: http://subsonicproject.com/ • CodePlex: http://www.codeplex.com/subsonic • Rob Conery: http://blog.wekeroad.com/ • Presentation Slides: http://www.fsdnug.org/previousMeetings.html

  14. Contact Info • Michael Paladino • Email: mpaladino@goeagleone.com • Blog: www.mpaladino.com • Twitter: www.twitter.com/mpaladino • LinkedIn: http://www.linkedin.com/in/michaelpaladino • Fort Smith .NET User Group • www.fsdnug.org

More Related