Iterator in MVC pattern

3

I'm doing a project and it was requested to build an iterator class. This whole project is being built based on the MVC standard. So, what would this class be Iterator and how am I going to use it? For what I've been researching seems to be of some use in implementing frameworks (lists, stacks etc.), but I do not quite understand it.

    
asked by anonymous 25.11.2015 / 12:19

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 for return an element of this structure and so on.

Most or all of the programming languages already come with ready-made and implemented frameworks for the developer to only make use of, if it is to perform the implementations of an Iterator manually, it will use Arrays constructing the logic in every necessary method, leaving the more dynamic so that the lists can grow and diminish as the use.

The Iterator should have no connection to the MVC architectural standard, you may have seen something about layers by the division of responsibility when implementing the Iterator in different data structures, but it seems unlikely.

    
05.12.2015 / 17:46