Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Have you ever heard "Position" design pattern?

In these days, I'm studying data structure. In my data structure book, the author said, "We'll use 'Position' design pattern" -> Photo

So I googled the Position design pattern because I wanted to know about it. However, I couldn't find any results. :'(

The author said, "The reason why we use Position design pattern is that we do not wish to allow user to modify internal structure." -> Photo 1 Photo 2
(e.g. not exposing method for accessing link when we return node element)

I absolutely agree with the author's opinion and intention, but I can't be sure about the word 'design pattern'

like image 983
Jonghwan Hyeon Avatar asked Nov 14 '12 14:11

Jonghwan Hyeon


1 Answers

The Position Pattern probably isn't as well known these days as most developers are working at a higher level of abstraction. We are using implementations of the position pattern when we use certain operations on collections - but we aren't implementing it ourselves.

[Opinion] You are more likely to find references to The Position Pattern in books that talk about lower level programming. Perhaps alongside The Iterator Pattern, for example, which many developers will never implement themselves but will use an implementation when they spin up a for each loop.

like image 172
Fenton Avatar answered Sep 23 '22 21:09

Fenton