Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeConverter #100

Closed
Hendy opened this issue May 9, 2015 · 19 comments
Closed

TypeConverter #100

Hendy opened this issue May 9, 2015 · 19 comments
Labels

Comments

@Hendy
Copy link
Contributor

Hendy commented May 9, 2015

convert from Picker to model property return type
see: https://gist.github.com/Hendy/da5d8a67e1711d195c9a

@Hendy Hendy self-assigned this May 9, 2015
@Hendy
Copy link
Contributor Author

Hendy commented May 19, 2015

Had to park this as realised the TypeConverter has a reference to Ditto - @leekelleher don't suppose you have any thoughts as to where best to put a TypeConverter that needs a reference to both Ditto and nuPickers ?

@Hendy Hendy added the question label May 19, 2015
@leekelleher
Copy link
Contributor

@Hendy With your original gist post, we do have some built-in TypeConverters with Ditto, (in next release, v0.7.0)

https://github.com/leekelleher/umbraco-ditto/tree/develop/src/Our.Umbraco.Ditto/ComponentModel/TypeConverters

As for something that overlays both Ditto and nuPickers, it would need to be a separate project/assembly... I face the same issue when developing custom Courier data-resolvers for property-editors (e.g. Archetype, Mortar).

@Hendy
Copy link
Contributor Author

Hendy commented May 21, 2015

Would be good to have a base TypeConverter that will convert from IPublishedContent to a custom POCO (as in gist above) and have a nuPicker TypeConverter inherit from this. The nuPicker TypeConverter would then just need to supply this base class with Picker.AsPublishedContent()

@leekelleher
Copy link
Contributor

@Hendy we do have DittoContentPickerConverter, (in the next version, v0.7.0), that can accept an IPublishedContent - could that be reused?

@Hendy
Copy link
Contributor Author

Hendy commented May 21, 2015

@leekelleher yep 👍 have just been discussing this with @JimBobSquarePants on Skype. Seems that the only reason I wrote the IPublishedContent -> POCO TC in the gist above is that I didn't pay any attention to the DittoMultiNodeTreePickerConverter due to it's name ! I think a better name would be "DittoPickerConverter".

@JimBobSquarePants
Copy link

💯 On the name. It's a misnomer now.

@Hendy
Copy link
Contributor Author

Hendy commented May 22, 2015

@leekelleher @JimBobSquarePants using a "DittoPickerConverter" (or whatever it is to be called) as a base class for a nuPickerTypeConverter would be ideal, but instead of nuPickers referencing DItto (which would be awkward for the Umbraco package) where should we put such TypeConverters that reference both Ditto & 3rd parties ? as a separate project - Our.Umbraco.Ditto.Something ? /cc @mattbrailsford @robertjf

@leekelleher
Copy link
Contributor

leekelleher commented May 22, 2015 via email

@robertjf
Copy link

Is this package meant to contain TypeConverters relating to Ditto only? Should we have a more generic project name to reference other projects as well?

@robertjf
Copy link

Our.Umbraco.TypeConverters perhaps?

@Hendy
Copy link
Contributor Author

Hendy commented May 22, 2015

Would they be used outside of DItto ? (certainly a reference to Ditto would be required + any other 3rd party property-editors) I imagine this would be a single (optional) dll, most likely of relevance to people using VS.NET, so could be an independent NuGet package (no Umbraco package).

@Hendy
Copy link
Contributor Author

Hendy commented May 22, 2015

If it's unlikely to be used outside of Ditto (can you think of a use-case where they might be ?) then being a part of the Ditto repo makes sense (assuming of course that it's easy to create a separate NuGet package, as wouldn't want to force 3rd party installs with Ditto /cc @Jeavon)

IMHO, the word Collab seems a bit vague - call them what they are :) Our.Umbraco.Ditto.TypeConverters ?

@leekelleher
Copy link
Contributor

leekelleher commented May 22, 2015 via email

@Hendy
Copy link
Contributor Author

Hendy commented May 22, 2015

@leekelleher not sure what the "Value Resolvers" are but I'm sure you wouldn't want Ditto to know how to parse all the nuPicker SaveFormats - the goal I think is to decouple Ditto and 3rd party.

@mattbrailsford
Copy link

I'm wondering if these things should be kept as individual side projects of each package, kinda like what happens with courier resolvers at the moment. To have one large VS project that has dependencies on all the third party packages that need converters will make for one big dependency chain no? I was thinking each package dev would just create an add on DLL if they want to provide DITTO support?

@JimBobSquarePants
Copy link

Separate projects and nuget packages for each one most definitely but maybe a single location to store them? El Packeeros.

@leekelleher
Copy link
Contributor

@Hendy - ah yes, SaveFormat, the Achilles heel ;-)

@Hendy
Copy link
Contributor Author

Hendy commented May 22, 2015

@mattbrailsford arh yes, I hadn't considered all those dependencies, and that's the issue I was hoping to avoid ! So separate NuGet packages for each Ditto + 3rd party combo.

A nuPickers TypeConverter deriving from a core Ditto one would only be a few lines of code, so setting up the build process would be the bulk of the work !

Would a single repo building multiple NuGet packages would be preferable ? /cc @Jeavon if so, then Our.Umbraco.Ditto.ThirdParty assembly / namespaces ?

@Jeavon
Copy link
Contributor

Jeavon commented May 22, 2015

@Hendy yes a single repo makes sense with a project for each package. Only thing to consider is that all the packages will version together if in a single repo, I don't think it's a problem. We have the same setup with Optimus and all it's providers...

@Hendy Hendy removed their assignment Apr 15, 2017
@Hendy Hendy closed this as completed Jul 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

6 participants