introduction to frameworks
TRANSCRIPT
![Page 1: Introduction to frameworks](https://reader030.vdocuments.net/reader030/viewer/2022032615/55a2845b1a28ab391d8b46e4/html5/thumbnails/1.jpg)
Introduction to Frameworks
![Page 2: Introduction to frameworks](https://reader030.vdocuments.net/reader030/viewer/2022032615/55a2845b1a28ab391d8b46e4/html5/thumbnails/2.jpg)
Objective
I want to be a software engineer
![Page 3: Introduction to frameworks](https://reader030.vdocuments.net/reader030/viewer/2022032615/55a2845b1a28ab391d8b46e4/html5/thumbnails/3.jpg)
My first application
• I don’t know any language
• Well let’s choose a language for application programming and start learning.
![Page 4: Introduction to frameworks](https://reader030.vdocuments.net/reader030/viewer/2022032615/55a2845b1a28ab391d8b46e4/html5/thumbnails/4.jpg)
… after 2 month
• I have learned programming .. I am good at it and I can build any thing ….
![Page 5: Introduction to frameworks](https://reader030.vdocuments.net/reader030/viewer/2022032615/55a2845b1a28ab391d8b46e4/html5/thumbnails/5.jpg)
My first application
• As I can build anything I want to build a chess… I am a very good chess player.
• I know all the rules and I know how to program ... What else do I need…
![Page 6: Introduction to frameworks](https://reader030.vdocuments.net/reader030/viewer/2022032615/55a2845b1a28ab391d8b46e4/html5/thumbnails/6.jpg)
Week 1
![Page 7: Introduction to frameworks](https://reader030.vdocuments.net/reader030/viewer/2022032615/55a2845b1a28ab391d8b46e4/html5/thumbnails/7.jpg)
Week 2
![Page 8: Introduction to frameworks](https://reader030.vdocuments.net/reader030/viewer/2022032615/55a2845b1a28ab391d8b46e4/html5/thumbnails/8.jpg)
Week 3
![Page 9: Introduction to frameworks](https://reader030.vdocuments.net/reader030/viewer/2022032615/55a2845b1a28ab391d8b46e4/html5/thumbnails/9.jpg)
My first application
• After three weeks 600 lines of code.
• Ok it’s easy.
• After a month it’s 3500 lines of code in one file. Certainly I find scroll bar is very useful.
![Page 10: Introduction to frameworks](https://reader030.vdocuments.net/reader030/viewer/2022032615/55a2845b1a28ab391d8b46e4/html5/thumbnails/10.jpg)
My first application
• But when a bug occurs … lets debug it.
• Now it seems building application is not as fun as it ought to be.
• Now after learning a good lesson … well try something different.
![Page 11: Introduction to frameworks](https://reader030.vdocuments.net/reader030/viewer/2022032615/55a2845b1a28ab391d8b46e4/html5/thumbnails/11.jpg)
My first application
• Writing in one file creating problems .. :-?
3686
![Page 12: Introduction to frameworks](https://reader030.vdocuments.net/reader030/viewer/2022032615/55a2845b1a28ab391d8b46e4/html5/thumbnails/12.jpg)
My first application
Ok I will write small codes in different files…
![Page 13: Introduction to frameworks](https://reader030.vdocuments.net/reader030/viewer/2022032615/55a2845b1a28ab391d8b46e4/html5/thumbnails/13.jpg)
My first application
OMG now I have 100 files and to change some thing I have to change 10 files … it is worst than I imagined.
![Page 14: Introduction to frameworks](https://reader030.vdocuments.net/reader030/viewer/2022032615/55a2845b1a28ab391d8b46e4/html5/thumbnails/14.jpg)
My first application
I think I have found the problem .. Thisapplication may be very big and I alone can’tcomplete it. Let’s ask a friend.
![Page 15: Introduction to frameworks](https://reader030.vdocuments.net/reader030/viewer/2022032615/55a2845b1a28ab391d8b46e4/html5/thumbnails/15.jpg)
My first application
• Arrrrghhhh….
• Well we code differently so many misunderstanding… it complicates things more
![Page 16: Introduction to frameworks](https://reader030.vdocuments.net/reader030/viewer/2022032615/55a2845b1a28ab391d8b46e4/html5/thumbnails/16.jpg)
My first application
• Let’s stop trying and toiling
• Think, how people writes a code which has millions of lines and thousands of developers
• How ?????
• …
![Page 17: Introduction to frameworks](https://reader030.vdocuments.net/reader030/viewer/2022032615/55a2845b1a28ab391d8b46e4/html5/thumbnails/17.jpg)
My first application
• Let’s see what can be done…
• There is something wrong . What is the problem ?
![Page 18: Introduction to frameworks](https://reader030.vdocuments.net/reader030/viewer/2022032615/55a2845b1a28ab391d8b46e4/html5/thumbnails/18.jpg)
Solutions
• Separability
• Independence
• Readablity
![Page 19: Introduction to frameworks](https://reader030.vdocuments.net/reader030/viewer/2022032615/55a2845b1a28ab391d8b46e4/html5/thumbnails/19.jpg)
My first application
• Ok I successfully build a chess game
• Now I want to build checker or other board games.
![Page 20: Introduction to frameworks](https://reader030.vdocuments.net/reader030/viewer/2022032615/55a2845b1a28ab391d8b46e4/html5/thumbnails/20.jpg)
My Next Applications
• I am so lazy, but I have to handle some things again that I have handled in chess game before. Like,
– Point Table
– Player Switching
– Board status
– Pieces
– Save, load, undo, redo etc….
![Page 21: Introduction to frameworks](https://reader030.vdocuments.net/reader030/viewer/2022032615/55a2845b1a28ab391d8b46e4/html5/thumbnails/21.jpg)
DRY
• If I implement them again it will be wastage of time.
• Don't Repeat Yourself (DRY)
• Reduce repetition of code of all kinds
![Page 22: Introduction to frameworks](https://reader030.vdocuments.net/reader030/viewer/2022032615/55a2845b1a28ab391d8b46e4/html5/thumbnails/22.jpg)
DRY
• I want to reuse code that I used before in chess game
![Page 23: Introduction to frameworks](https://reader030.vdocuments.net/reader030/viewer/2022032615/55a2845b1a28ab391d8b46e4/html5/thumbnails/23.jpg)
DRY
• The functions need to customize as it was written in chess game i have to change it so that it also work for checker.
![Page 24: Introduction to frameworks](https://reader030.vdocuments.net/reader030/viewer/2022032615/55a2845b1a28ab391d8b46e4/html5/thumbnails/24.jpg)
DRY
• Some times this changes are different because there are so many options and varieties of board games
![Page 25: Introduction to frameworks](https://reader030.vdocuments.net/reader030/viewer/2022032615/55a2845b1a28ab391d8b46e4/html5/thumbnails/25.jpg)
DRY
• If I write those functionalities in a sort of generalized way such that it can be used in all board games.
• Then I can develop this games very fast without repeating myself.
![Page 26: Introduction to frameworks](https://reader030.vdocuments.net/reader030/viewer/2022032615/55a2845b1a28ab391d8b46e4/html5/thumbnails/26.jpg)
DRY
• Now I can separate the similar codes that I can reuse for these board games.
• If I need to build checker then I need similar structure as chess game.
![Page 27: Introduction to frameworks](https://reader030.vdocuments.net/reader030/viewer/2022032615/55a2845b1a28ab391d8b46e4/html5/thumbnails/27.jpg)
DRY
• If there is a structure that has similar features for these games then I do not need to start from the beginning.
• I can straight jump into game logic.
logic
![Page 28: Introduction to frameworks](https://reader030.vdocuments.net/reader030/viewer/2022032615/55a2845b1a28ab391d8b46e4/html5/thumbnails/28.jpg)
Frameworks
• The structure that I built to use for all board games can be called framework.
• A reusable set of libraries or classes for a software system.
• Used to implement the standard structure of an application.
![Page 29: Introduction to frameworks](https://reader030.vdocuments.net/reader030/viewer/2022032615/55a2845b1a28ab391d8b46e4/html5/thumbnails/29.jpg)
Few Frameworks
• For web application– Symfony
– Zend
– CodeIgniter
– CakePHP
– .NET
– Django
• For desktop application– Qt C++
– WxWidget
![Page 30: Introduction to frameworks](https://reader030.vdocuments.net/reader030/viewer/2022032615/55a2845b1a28ab391d8b46e4/html5/thumbnails/30.jpg)
• Here is an idea. I am a human why should I repeat another humans work.
• I haven't coded yet but I need not to because some one has already coded it for others to reuse.
• There is no point to reinvent the wheel
![Page 31: Introduction to frameworks](https://reader030.vdocuments.net/reader030/viewer/2022032615/55a2845b1a28ab391d8b46e4/html5/thumbnails/31.jpg)
MVC
![Page 32: Introduction to frameworks](https://reader030.vdocuments.net/reader030/viewer/2022032615/55a2845b1a28ab391d8b46e4/html5/thumbnails/32.jpg)
Model
• "Represent knowledge"
• The data/business functionality
![Page 33: Introduction to frameworks](https://reader030.vdocuments.net/reader030/viewer/2022032615/55a2845b1a28ab391d8b46e4/html5/thumbnails/33.jpg)
View
• Visual representation of the model
• The screens and widgets of app
• Gets data from model & updates model
![Page 34: Introduction to frameworks](https://reader030.vdocuments.net/reader030/viewer/2022032615/55a2845b1a28ab391d8b46e4/html5/thumbnails/34.jpg)
Controller
• Link between user and system
• Responsible for intercepting user input
• Passes user input to view via messages
![Page 35: Introduction to frameworks](https://reader030.vdocuments.net/reader030/viewer/2022032615/55a2845b1a28ab391d8b46e4/html5/thumbnails/35.jpg)
Questions?