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 trial

Android Build an Interactive Story App (Retired) The Model-View-Controller Pattern Implementing the Data Model

About the choice and page class ?

Hello.

I didn't actually get the choice and page class...what is the purpose of those class?

can somebody explain it to me?

1 Answer

J A
seal-mask
.a{fill-rule:evenodd;}techdegree
J A
Full Stack JavaScript Techdegree Student 4,646 Points

Pages and Data are the model portion of the MVC pattern. Separating your pages of the story and the choices you make into different classes allows them to be reused when you need to put them in a different class and keeps your code clean.

Hi thanks for answering...can you explain me what the duty of page class please?

J A
seal-mask
.a{fill-rule:evenodd;}techdegree
J A
Full Stack JavaScript Techdegree Student 4,646 Points

Hi yadin michaeli ,

The Page class abstracts the detail of each Page of the story. It contains the text of the page as well as the choices a user has when they come to that page. The application is a story and stories are told with pages so the Page class represents that data.