[MTE-31] Dialog filenames should not use ".dialog" Created: 02/Jun/15  Updated: 24/Jun/15  Resolved: 23/Jun/15

Status: Closed
Project: Magnolia Templating Essentials
Component/s: None
Affects Version/s: None
Fix Version/s: 0.5

Type: Improvement Priority: Neutral
Reporter: Christopher Zimmermann Assignee: Espen Jervidalo
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Relates
relates to MGNLDEMO-55 Dialog filenames should not use ".dia... Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Date of First Response:

 Description   

The convention should be
templatename.yaml
Not
templatename.dialog.yaml

The dot is especially confusing because one references a dialog by its name - not its filename.
But when the name has the dot in it, this is not so clear. A dash is a normal filename character.

For the reasons presented in the comments - the dialog file name should be the same name as the template name - just in a different directory.



 Comments   
Comment by Philip Mundt [ 02/Jun/15 ]

I would vote against this pattern:

  • Initial reason for adding the suffix was the idea of having everything related to a component config in one folder (dialog, template and definition) – we need a way to identify the dialog
  • It adds rendundancy/duplication
  • We should have a consistent form of naming dialogs throughout the system (no dialog so far has dialog in its name)

I would actually get rid of the .dialog.

Comment by Christian Ringele [ 02/Jun/15 ]

I agree on ph's comment.

I would vote against bith patterns:
Leave the dialog away.

As the path alrady indicates what it is.
Comparable to the registry in jcr config.

Also think about the id of a dialog you set in the template def:
dialog=modulename:something.dialog
Or
dialog=modulename:something-dialog
Makes it redundand and "more complcated"

Usually you want to copy paste:
Template name can be copy & pasted into the file name of dialog, into yaml file itsef, into id etc.
Anything you have to add you loose time.

Comment by Christopher Zimmermann [ 03/Jun/15 ]

Thanks for your comments, I find them all reasonable and compelling.
The downsides of both files having the same name:

  • when working with files, in most editors if you have both files open in tabs - you will not know which one is which.
  • Also (depending on the editor) when searching for a dialog or template definition it won't be as easy to find your target.
Comment by Christian Ringele [ 03/Jun/15 ]

I see the downsides you describe, but I think they don't make up for the other downsides.

The content of the files is quite different, I think with a little bit of practice people see fast if its a template def or a dialog def.

But the downsides of having redundancy in the file names stays for the whole project /use of Magnolia, no matter how experienced you are.
So that will always cost you time in a project, which is out of my view the bigger downside.

And also:
Don't overrate the help the word "dialog" would provide in a file name.
I use exactly this in the very first exercise in the training:
Template def is called 'sampleTemplate'
Dialog is called 'sampleTemplateDialog'
Script is called 'sampleTemplateScript'
(Explaining them that such a redundancy naming is bad practice)

And you would be surprised how they are still confused what to do where.
Even when a instruction says clearly: "Go to you 'sampleTemplateDialog' dialog configuration located in xxx and add into xxx a field called xxx..."
Why?
Because they are beginners and have no clue yet what is what. The word "dialog' is empty for them, a blank sheet.
So the word 'dialog' in the dialogs name doesn't really help them as much as one could think.
And as soon as they understand what a dialog is, they know from looking at one that it is one.

Generated at Mon Feb 12 07:40:46 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.