1 / 15

CodeSmith & .netTiers Using Code Generation to boost productivity

CodeSmith & .netTiers Using Code Generation to boost productivity. Robert Hinojosa rhinojosa@codesmithtools.com. Agenda. What is Code Generation? What is CodeSmith? What is .netTiers? How can .netTiers help me?. What is Code Generation. Software creation Can be fun and challenging

guiliaine
Download Presentation

CodeSmith & .netTiers Using Code Generation to boost productivity

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. CodeSmith & .netTiersUsing Code Generation to boost productivity Robert Hinojosarhinojosa@codesmithtools.com

  2. Agenda • What is Code Generation? • What is CodeSmith? • What is .netTiers? • How can .netTiers help me?

  3. What is Code Generation • Software creation • Can be fun and challenging • …but also repetitive and monotonous • Repetition & monotony leads to bugs • Code generation is not a new concept • With most tools you don’t control the output • Often viewed as a “Black Box” solution • Ex, data layer created (but it is not your code) • CodeSmith 4.0 • Not a “Black Box” solution • Template driven code generation (it is your code) • Use existing templates or write new ones

  4. The value of .netTiers • The cost of creating a home grown framework • Design, Development, Test, Release • Easily runs between $50 - $300/hour • CodeSmith • .netTiers 2.0: Free open source templates with thriving community • CodeSmith 4.0 Professional: $399 • For you, FREE! • Equivalent to 3-6 hours of development • Real value you can measure • Dramatically reduces time to market & cost • Quickly pays for itself

  5. Using CodeSmith 4.0

  6. What is .netTiers .netTiers is a library of Codesmith templates that builds object-relational mapping for an existing database. • Creates objects and domain based on the relationships in your database. • Creates separate Logical layers Entity, DAL, Business, Web, Forms, WebService • Creates stored procedures or parameterized SQL for data access layer. • Creates Asp.Net 2.0 admin user controls. • Creates code which is fully XML commented

  7. .netTiers Advantages • 100% Open Source, Template Driven • Reduces development time • Reduces maintenance time • All applications have a consistent domain model, with standard code • Making changes / updates by another team member easier • Promotes reuse • Data Access completely separated from user interface • Promotes Enterprise Standards utilizing Microsoft P & P Enterprise Library • Easier Application Integration

  8. Domain Model vs DataSet • Predictable behavior • Compare the following methods • public Customer GetByCustomerId(int id); • public DataSet GetByCustomerId(int id); • Promotes loose coupling of presentation and domain logic • Easier to document • Intellisense in Visual Studio • Less memory intensive

  9. Using .netTiers

  10. Data API • Support for basic CRUD: Update, Delete, Insert, Find, Paged, Custom Sprocs, GetBy (PK, IX, FK, M:M) • Support for queries using: • Primary Key • Foreign keys • Indexes • Many-Many join relationships

  11. Data API • Transaction Support • API Plumbing generated from Your own Stored ProceduresEX. _TableName_MyMethodName • Support for deep object graph loading/saving • Use stored procedures or xml embedded parameterized SQL

  12. Sample Method Calls //All Providers kept within DataRepository class EmployeeCollection employees = DataRepository.EmployeeProvider.GetAll(); //When using primary key, single object is returned Employee emp = DataRepository.EmployeeProvider.GetByEmployeeId(4); Employee newEmployee = new Employee(); newEmployee.FirstName = “John”; newEmployee.LastName = “Doe”; … //when inserting the primary key value is set for the object bool success = DataRepository.EmployeeProvider.Insert(newEmployee); //inserting collection EmployeeCollection ec = new EmployeeCollection(); Employee e1 = new Employee(); … ec.Add(e1); bool success = DataRepository.EmployeeProvider.Insert(ec);

  13. Using .netTiers API

  14. Conclusion/ Q&A • .netTiers 2.0 • Proven Pattern Based Framework Generation • CodeSmith 4.0 • Most powerful code generation tool available • Reduces time spent writing trivial code • Be more productive • Template driven means it’s still your code • Saves you time and money

  15. Learn more • www.codesmithtools.com • Download free 30 day trial Contact Us • sales@codesmithtools.com • +1 972 407 0688

More Related