Iterator in MVC pattern

Asked

Viewed 43 times

3

I am doing a project and it was asked to build an iterator class. This whole project is being built based on the MVC standard. So what would this Iterator class be and how would I use it? By q I’ve been researching seems to have some utility in implementing structures (lists, stacks etc), but I don’t understand very well.

  • 3

    I think this Iterator has nothing to do with the MVC standard, just a business rule of the project you’re building. It’s not easier to ask the guys there?

  • put more details in your explanation

1 answer

0


An Iterator or Iterator, is used to check and traverse data structures, as mentioned, Lists, Stacks, Queues, Sets, Tree, in an iterator you will implement checks to see if there are more elements within the structure, method to return an element of this structure and etc.

Most or if not all programming languages already come with ready-made and implemented structures for the developer to just make use of if you are going to perform the implementations of an Iterator manually , will make use of Arrays building the logic in each necessary method, leaving as dynamic as possible so that the lists can grow and decrease as the use.

Iterator should have no connection to MVC architectural pattern, it is possible that it has seen something referring to layers by the division of responsibility when implementing Iterator in different data structures, yet it seems unlikely.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.