marco-pm / zencart_instantsearch

Instant Search plugin for Zen Cart
GNU General Public License v3.0
2 stars 4 forks source link

potential refactor #3

Closed proseLA closed 2 years ago

proseLA commented 3 years ago

with all vars being only part of each local method, with each observer, they have to be explicitly passed.

if the vars were in turn made part of the class, there would be no need to pass any parms to the notifier, as all vars part of $this would be available in the observer.

i have no strong feeling either way; although i'm a fan of making them part of the class.

proseLA commented 3 years ago

the more i think about it, i think establishing vars as part of the class would be the way to go. i think it provides more flexibility if someone wanted to extend the class (even though there is only 1 method in the class).

personally i am a bigger fan of extending classes, then i am of the observer/notifier system, but rather hard to do in ZC. but i think this plugin would be better if someone could do that.