Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialJorge Escalante
Front End Web Development Techdegree Student 2,080 PointsWhat is a module ?
In the graphics of this video Pasan use a illustration called mod, what exactly is ?
5 Answers
Fahad Alrahbi
1,080 Pointsyou have to understand two things to understand the module ,
Moduls View Controller
Moduls = > just think it's a place to save any information you will need it in your app , example
if i have array of country names , i will create new class i will called => AppInfo.h / AppInfo.m
now whenever i need this information i will call this class and i will call the array , that mean the class is response to store the informations only , not doing any calculation just storing , so that was only an example storing country on class , but on the real instate of storying country in array , we can store them in database , core data , iCloud and we can call them our modules ,
now that was about modules
about view
whenever your information is displaying , the place for displaying this information is called view
finally is controller ,
As i said view is displaying the information from module but the question is who will call this information from modules to view ?
this we called controller because he is controlling the things between modules and view .
i hope that make help.
shezazr
8,275 PointsAs I understand it, a module is a complete piece of code that allows you to do something ideally in one class.. say for example a User class.. that allows you to add/edit/delete/ users.. you would pull that into your project as module so that you don't have to reinvent the wheel (re-write what is available already)
Fahad Alrahbi
1,080 PointsMr shez , as your example, the clas whose doing Add Edit Delete
This we called controller, but , the place where the data is stored we called model , example of models Core Data, SQlite ..
shezazr
8,275 PointsAs I understand it, a module is a complete piece of code that allows you to do something ideally in one class.. say for example a User class.. that allows you to add/edit/delete/ users.. you would pull that into your project as module so that you don't have to reinvent the wheel (re-write what is available already)
Jorge Escalante
Front End Web Development Techdegree Student 2,080 Pointsthanks for your help guys !!