Active Records Barcamp Cameroon 2009


Published on

an introduction to Active Records to Cameroonian the barcampcameroon 2009

Published in: Technology
  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Active Records Barcamp Cameroon 2009

  1. 1. Active Record Presentation by Mambe Churchill Nanje CEO, At Barcamp Cameroon 2009
  2. 2. What is Active Record? Active Record is an implementation of Object Relational Mapping where in a database is manipulated by highly linked objects(MODELS) interfacing the database tables and their content e.g instead of SELECT * FROM accounts WHERE user=1 with Active records we do user=new User(1); //sql gets generated for you
  3. 3. Assumed Knowledge To fully understand active record you need to understand the following <ul><li>Object Oriented Programming(Java, PHP, Python, C#, Ruby)‏ </li></ul><ul><li>Relational Database Management Systems(MySQL, Oracle, MSSQL Server)‏ </li></ul>
  4. 4. HOW IT WORKS Example: car park management system Database of Cars Code without Active Record: connection=new Connection(h,u,p); query='select * from cars where id=1'; rs=connection.statement.execute(query); car=rs.get(0); print(car.brand); //mercedes print(car.owner); //francis Code With Active Record: database=new Database(h,u,p); car=database.get('cars',1); print(car.brand); //mercedes print(car.owner); //francis
  5. 5. CASE STUDY WWW.UBSTUDENTS.COM : 2007 <ul><li>With Active Records I did the following in 7days </li></ul><ul><li>manage student accounts </li></ul><ul><li>manage student news and comment </li></ul><ul><li>manage student pictures and comments </li></ul><ul><li>manage student friendship request and social connections </li></ul>University of Buea Students online portal
  6. 6. CASE STUDY WWW.NAIJABORN.COM : 2009 CASE STUDY <ul><li>With Active Records I did the following in 2days </li></ul><ul><li>Full data abstraction of user profiles </li></ul><ul><li>Full data abstraction of user pictures </li></ul><ul><li>Full data abstraction of user posts, art and music </li></ul><ul><li>Full data abstraction of user networks, </li></ul><ul><li>Full data abstraction of user private messages </li></ul><ul><li>Full data abstraction of user comments </li></ul>Online community of Nigerians and their career info
  7. 7. CASE STUDY WWW.AFRIKEO.COM 2008 <ul><li>With Active Records I did the following in 2days </li></ul><ul><li>Fully functional search engine model </li></ul><ul><li>Highly optimised administrative backend models for managing news,blog, classified source data </li></ul><ul><li>Easy data model for country based articles sorting </li></ul>Aggregator and search engine for African news, blogs, classified
  8. 8. CASE STUDY WWW.VILLAGEDIARY.ORG : 2009 <ul><li>With Active Records I did the following in 4days </li></ul><ul><li>Full data management of user/admin profiles </li></ul><ul><li>Full data management of locations/villages </li></ul><ul><li>Full data management of diary entries </li></ul><ul><li>Full data management of diary entry comments </li></ul><ul><li>Full data management of case workers to diary entry relationships </li></ul><ul><li>Full data management of diary entry to document types, entry types and subtypes manipulation </li></ul>Online platform to record cases in villages
  9. 9. Advantages of Active Record • Productivity – Eliminates lots of repetitive code – focus on business logic – Database code is generated automatically • Maintainability – Fewer lines of code – easier to understand – Easier to manage change in the object model • Performance – Lazy loading – associations are fetched when needed – Caching • Database vendor independence – The underlying database is abstracted away – Can be configured outside the application
  10. 10. More about Active Record <ul><li>You can read more about active record here </li></ul><ul><li>Highly integrated into Frameworks like Hibernate(Java), Ruby on Rails(Ruby), KohanaPHP(php), Django(python), Castle MonoRails(C#)‏ </li></ul>Cool Example Code allCars=database.find_all('cars'); cars=database.get_where_brand('cars','mercedes'); cars=database.get('cars',1);
  11. 11. Thank you For more informationa about me other links