Have you ever heard the design template "Position"?

These days I am studying the data structure. In my book on data structures, the author said: "We will use the design template" Position "" → Photo

So, I was looking for the Position design template because I wanted to know about it. However, I could not find any results .: '(

The author said: “The reason we use the position design template is because we don’t want to allow the user to change the internal structure.” → Photo 1 Photo 2
(for example, without setting a method to access the link when we return the node element)

I absolutely agree with the author’s opinion and intention, but I can’t be sure of the word “design template”

+6
source share
1 answer

The position template is probably not yet well known, since most developers work at a higher level of abstraction. We use the implementation of the position template when we use certain operations on collections, but we ourselves do not implement it.

[Opinion] You are likely to find links to The Position Pattern in books that talk about lower-level programming. Perhaps along with the Iterator template, for example, many developers will never implement themselves, but will use the implementation when they start the for each loop.

+3
source

All Articles