See my comments inline... On Sun, Jul 5, 2020 at 2:49 PM Siegfried Goeschl < siegfried.goes...@gmail.com> wrote:
> Hi Daniel, > > Please see my comments below > > Thanks in advance, > > Siegfried Goeschl > > > > > On 05.07.2020, at 13:42, Daniel Dekany <daniel.dek...@gmail.com> wrote: > > > > The reason I was asking is that if all functionality goes in > DataSourcers, > > the methods will shadow data source names. Like if you have a data source > > named "empty", then DataSources.empty will not return that, instead it > will > > call isEmpty(). That also means that adding new methods to DataSource is > > not backward compatible. So probably we will need a separate DataSources, > > and DataSourceTool or something. (It's also possible to reverse > priorities, > > but that's even less manageable for the user.) > > Thanks, I was not aware of that - let me recap my understanding > > If I have a data source "empty", e.g. "empty=somepath/some.csv" > > * DataSources.empty would call DataSources.isEmpty() > * DataSources["empty"] would fetch the data source "empty" > Yeah, so thing is, in FreeMarker, foo.bar and foo["bar"] are exactly the same. Furthermore, foo.bar() is just foo.bar, and then () operator is applied on it's value (which is a method as a first class value). > * DataSources.get("empty") would fetch the data source "empty" since it > calls DataSources.get(String) > Yes. > Some thoughts along the line > > * The names of a list of data sources are not enforced to be unique so the > map functionality is slightly broken > Why not? That was also a quite important problem. I guess I even listed it in the recent mail... or not. So these names and groups, should be consolidated too. > * Tools for me are stateless and can be potentially shared so I can not > put the data sources for the current transformation in there > I guess, technically speaking, you can. You are in the context of a freemarker-generator run (or whatever the term for that is... session?). Where's the ambiguity, or similar issue, if any? [snip] -- Best regards, Daniel Dekany