OMG

XML application problems

Bug #622718 reported by Patryk Zawadzki
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OMG
New
Undecided
Unassigned

Bug Description

The XML branch of OMG commits to a number of really bad practices:

 * you go with Pascal/Java-style "CamelCase" where XML calls for "hyphenated-names" or classic "camelCasing"
 * you use elements for atomic types where best practices call for an attribute (ie. "<trophy priority="2">)
 * you've invented your own translation format ignoring the fact that intltool comes with out-of-the-box support for XML files
 * you reference and import "xsi" and "xsd" namespaces despite not using any of them
 * you provide your own schema for no apparent reason, you never reference it
 * title is not translatable
 * the "friendly application name" is redundant as you can get a translated version from the referenced desktop file

Revision history for this message
Seif Lotfy (seif) wrote : Re: [Bug 622718] [NEW] XML application problems

Thanks dude...
Would you like to work on it with us :)

On Mon, Aug 23, 2010 at 3:31 PM, Patryk Zawadzki <email address hidden>wrote:

> Public bug reported:
>
> The XML branch of OMG commits to a number of really bad practices:
>
> * you go with Pascal/Java-style "CamelCase" where XML calls for
> "hyphenated-names" or classic "camelCasing"
> * you use elements for atomic types where best practices call for an
> attribute (ie. "<trophy priority="2">)
> * you've invented your own translation format ignoring the fact that
> intltool comes with out-of-the-box support for XML files
> * you reference and import "xsi" and "xsd" namespaces despite not using
> any of them
> * you provide your own schema for no apparent reason, you never reference
> it
> * title is not translatable
> * the "friendly application name" is redundant as you can get a translated
> version from the referenced desktop file
>
> ** Affects: omg
> Importance: Undecided
> Status: New
>
> --
> XML application problems
> https://bugs.launchpad.net/bugs/622718
> You received this bug notification because you are a member of OMG!,
> which is subscribed to omg.
>
> Status in OMG!: New
>
> Bug description:
> The XML branch of OMG commits to a number of really bad practices:
>
> * you go with Pascal/Java-style "CamelCase" where XML calls for
> "hyphenated-names" or classic "camelCasing"
> * you use elements for atomic types where best practices call for an
> attribute (ie. "<trophy priority="2">)
> * you've invented your own translation format ignoring the fact that
> intltool comes with out-of-the-box support for XML files
> * you reference and import "xsi" and "xsd" namespaces despite not using
> any of them
> * you provide your own schema for no apparent reason, you never reference
> it
> * title is not translatable
> * the "friendly application name" is redundant as you can get a translated
> version from the referenced desktop file
>
>
>

--
This is me doing some advertisement for my blog http://seilo.geekyogre.com

Revision history for this message
Patryk Zawadzki (patrys) wrote :

I'd suggest taking a look at http://github.com/tbaugis/gnome-achievements/wiki/Trophy-configuration and discuss why you don't want to use that instead :)

Revision history for this message
Chris S. (cszikszoy) wrote :

Seif, I mentioned to you the other day that it's completely unnecessary to
write your own XML scheme. C# can do XML serialization automatically. Like
I said when we talked last, make a collection of trophies
(IEnumerable<Trophy>, etc) and use XML serialization. That will allow you
to effortlessly (~2 lines or so) import any XML file containing trophies,
and it will be turned back into that collection in C#.

Revision history for this message
Manish Sinha (मनीष सिन्हा) (manishsinha) wrote :

@Patryk Zawadzki
I was the person who made that commit. I would like to address your points one by one

>> * you go with Pascal/Java-style "CamelCase" where XML calls for "hyphenated-names" or classic "camelCasing"
Didn't get this one.

>> * you use elements for atomic types where best practices call for an attribute (ie. "<trophy priority="2">)
Oh. I missed this. Will fix it.

>> * you've invented your own translation format ignoring the fact that intltool comes with out-of-the-box support for XML files
Please explain this a bit. I am lost here.

>> * you reference and import "xsi" and "xsd" namespaces despite not using any of them
Even though I worked a lot on XML, I have still not understood XML namespaces completely. On my day job, I use XML from XSD already provided by standardization teams inside the company.

>> * you provide your own schema for no apparent reason, you never reference it
Actually I did not create that schema. It is just part of the project so that people can know how to create the trophy files
I actually created the Data Structures(Classes) and serialized it. It generated the trophy XML file, from that XML file, I created the XSD file for third-party use, not our side. I just added it to the project so that we don' lose it and so that we can keep track of it.

>> * title is not translatable
I don't know, but we have discussed that Description is translatable. Probably

>> * the "friendly application name" is redundant as you can get a translated version from the referenced desktop file
We wanted the ApplicationName to be just an identifier for an application and FriendlyApplicationName to be some friendly name
e.g. "gedit" and "Gnome Text Editor"

Revision history for this message
Manish Sinha (मनीष सिन्हा) (manishsinha) wrote :

@Chris
XML schema has not been created by hand. I just slapped all the Root types with XmlRoot, XmlElement, XmlAttribute etc and it serlialzes to an XML file. From this fully and complete XML file, I created XSD using xsd.exe tool.

This schema file is not for our side, but for any other application developers to know how the Trophy XML file actually contains.
I referenced and added it to the project to keep it together or otherwise I can lose it if it's thrown randomly.

Revision history for this message
Patryk Zawadzki (patrys) wrote : Re: [Bug 622718] Re: XML application problems

>>> * you go with Pascal/Java-style "CamelCase" where XML calls for "hyphenated-names" or classic "camelCasing"
> Didn't get this one.

<ApplicationName> versus recommended <application-name> or popular
<applicationName>

>>> * you've invented your own translation format ignoring the fact that intltool comes with out-of-the-box support for XML files
> Please explain this a bit. I am lost here.

GNOME has an infrastructure in place to support translatable XML. For
an example see "XML files" under
http://people.gnome.org/~malcolm/i18n/marking-strings.html

>>> * you reference and import "xsi" and "xsd" namespaces despite not using any of them
> Even though I worked a lot on XML, I have still not understood XML namespaces completely. On my day job, I use XML from XSD already provided by standardization teams inside the company.

Importing namespaces only makes sense if you actually use them.

>>> * you provide your own schema for no apparent reason, you never reference it
> Actually I did not create that schema. It is just part of the project so that people can know how to create the trophy files
> I actually created the Data Structures(Classes) and serialized it. It generated the trophy XML file, from that XML file, I created the XSD file for third-party use, not our side. I just added it to the project so that we don' lose it and so that we can keep track of it.

Using a serialization format as a standard is hardly ever a good idea.
You should start by designing an XML application and then implement it
in your language of choice. Serialized formats are only meant to be
used to transport portions of data between applications written in the
same language.

In other words it's like asking people to consume and produce Python
pickles -- it might save you a couple of lines in code but only by
adding more work for others.

We designed the gnome-achievements XML format (as opposed to dumping
whatever the language thought about an object) to be as friendly as
possible to both app programmers and translators. This means being
gettext-friendly, intltool-friendly and simple enough to be written by
hand.

>>> * title is not translatable
> I don't know, but we have discussed that Description is translatable. Probably

Probably?

>>> * the "friendly application name" is redundant as you can get a translated version from the referenced desktop file
> We wanted the ApplicationName to be just an identifier for an application and FriendlyApplicationName to be some friendly name
> e.g. "gedit" and "Gnome Text Editor"

As I said above -- you can get the title from the desktop file. Both
correct and translated to the current locale.

--
Patryk Zawadzki

Revision history for this message
Manish Sinha (मनीष सिन्हा) (manishsinha) wrote :

>>> <ApplicationName> versus recommended <application-name> or popular <applicationName>
This can be fixed.

>>GNOME has an infrastructure in place to support translatable XML. For an example see "XML files" under http://people.gnome.org/~malcolm/i18n/marking-strings.html
Will look into it. Anyway we are following iterative model, so everything can be fixed

>>> Importing namespaces only makes sense if you actually use them.
That was generated by the tool. I just took it and added it to the project

>>Using a serialization format as a standard is hardly ever a good idea. You should start by designing an XML application and then implement it in your language of choice. Serialized formats are only meant to be used to transport portions of data between applications written in the same language.
I get this one, understand , but we have decided what all the XML should contain and also how the XML should look. I was just too lazy to create XSD for it. So created the XML and XSD from it. Verified it and pushed

>> In other words it's like asking people to consume and produce Python pickles -- it might save you a couple of lines in code but only by adding more work for others.
Initially we had BinaryFormatter which I removed as it also has the binary format storage. So I went with XML after confirming with all the people present on #omg!

>>> We designed the gnome-achievements XML format (as opposed to dumping whatever the language thought about an object) to be as friendly as possible to both app programmers and translators. This means being gettext-friendly, intltool-friendly and simple enough to be written by hand.

We also decided on the XML format and created XSD by the tool. Even if we dumped the XML by code, I did control the serialization to make sure that the XML created adheres to what we want it to do. I just didnt want to do all the XML typing by hand. Probably I can miss something.
We just have to keep it gettext and intltool friendly. We havn't thought much about it. Will do it for next iteration

>>> Probably?
Pardon me. I think I didn't finish typing and jumped to some other point to reply and hit Enter without reading the whole reply again

>>>As I said above -- you can get the title from the desktop file. Both correct and translated to the current locale.
Have to look into it, Our main aim was to make the the trophy developers easier top make trophies.

Revision history for this message
Seif Lotfy (seif) wrote :

@Patryk Zawadzki:

Sorry for the late response...
I looked over the xml schema however i disagree with the gold/silver/bronze ranking
I tend to see it as each an achievement of its own instead of one achievement with 3 statuses
Also I would like to see SETS. By a set i mean maybe a service (New Years Special) that monitors you activities on new Years form different applications. So while applications award their trophies, a set can award trophies too however under the application name of the application monitored but with a "name":
- This will allow me to filter by applications
- Filter by set of trophies that come from the same service.

I think Title should not be translatable or at least no harm is done by not translating it. However translating the description is a must.

Revision history for this message
Patryk Zawadzki (patrys) wrote :

I don't think we really want a third party app to be able to award trophies in the name of another app. All the bug reports would hit the wrong developers. Having said that, nothing stops you from setting the application field to something else. I don't see how "sets" add anything to the picture.

I also strongly believe all strings displayed should be translated. Not sure how you came up with the idea of keeping the title untranslated. Imagine a girl in France suddenly seeing an English string she does not understand pop up on her screen. Why would you want to do that?

Whatever you think about the format we came up with, please fix yours to at least look like proper XML.

Revision history for this message
Seif Lotfy (seif) wrote :

Yeah we will iterate over the XML stuff again... Thanks for noticing.
Well sets are fun in a way... I think it should be possible
also i noticed i could just use your format and always award GOLD :P
so i do like your format however i am missing the sets
I we can stick that in then I think manish wouldnt mind using your stuff :)

On Tue, Aug 24, 2010 at 2:19 PM, Patryk Zawadzki <email address hidden>wrote:

> I don't think we really want a third party app to be able to award
> trophies in the name of another app. All the bug reports would hit the
> wrong developers. Having said that, nothing stops you from setting the
> application field to something else. I don't see how "sets" add anything
> to the picture.
>
> I also strongly believe all strings displayed should be translated. Not
> sure how you came up with the idea of keeping the title untranslated.
> Imagine a girl in France suddenly seeing an English string she does not
> understand pop up on her screen. Why would you want to do that?
>
> Whatever you think about the format we came up with, please fix yours to
> at least look like proper XML.
>
> --
> XML application problems
> https://bugs.launchpad.net/bugs/622718
> You received this bug notification because you are a member of OMG!,
> which is subscribed to omg.
>
> Status in OMG!: New
>
> Bug description:
> The XML branch of OMG commits to a number of really bad practices:
>
> * you go with Pascal/Java-style "CamelCase" where XML calls for
> "hyphenated-names" or classic "camelCasing"
> * you use elements for atomic types where best practices call for an
> attribute (ie. "<trophy priority="2">)
> * you've invented your own translation format ignoring the fact that
> intltool comes with out-of-the-box support for XML files
> * you reference and import "xsi" and "xsd" namespaces despite not using
> any of them
> * you provide your own schema for no apparent reason, you never reference
> it
> * title is not translatable
> * the "friendly application name" is redundant as you can get a translated
> version from the referenced desktop file
>
>
>

--
This is me doing some advertisement for my blog http://seilo.geekyogre.com

Revision history for this message
tm (toms-baugis) wrote :

just to straighten out on comment #8 - an achievement in g-a is either bronze, silver or gold [1]. the rank denotes the asserted difficulty to achieve the target or can be used to advertise the trophy as more valuable than other.
as not all achievements are of same difficulty or relevance, a rank makes sense. i believe you have the "priority" field for that

[1] as you can see in the actual use of the format:
http://github.com/tbaugis/gnome-achievements/blob/master/data/achievements/hamster-applet.trophies.xml

Revision history for this message
Seif Lotfy (seif) wrote :

The priority part is actually for telling the notification how important it
is to notify about the achievement.
but yeah i get your point however in that case i wouldn't put it in
bronze/silver/gold but rather easy/normal/difficult
But yeah i could go with that... But I am missing sets

On Tue, Aug 24, 2010 at 2:56 PM, tm <email address hidden> wrote:

> just to straighten out on comment #8 - an achievement in g-a is either
> bronze, silver or gold [1]. the rank denotes the asserted difficulty to
> achieve the target or can be used to advertise the trophy as more valuable
> than other.
> as not all achievements are of same difficulty or relevance, a rank makes
> sense. i believe you have the "priority" field for that
>
> [1] as you can see in the actual use of the format:
>
> http://github.com/tbaugis/gnome-achievements/blob/master/data/achievements/hamster-applet.trophies.xml
>
> --
> XML application problems
> https://bugs.launchpad.net/bugs/622718
> You received this bug notification because you are a member of OMG!,
> which is subscribed to omg.
>
> Status in OMG!: New
>
> Bug description:
> The XML branch of OMG commits to a number of really bad practices:
>
> * you go with Pascal/Java-style "CamelCase" where XML calls for
> "hyphenated-names" or classic "camelCasing"
> * you use elements for atomic types where best practices call for an
> attribute (ie. "<trophy priority="2">)
> * you've invented your own translation format ignoring the fact that
> intltool comes with out-of-the-box support for XML files
> * you reference and import "xsi" and "xsd" namespaces despite not using
> any of them
> * you provide your own schema for no apparent reason, you never reference
> it
> * title is not translatable
> * the "friendly application name" is redundant as you can get a translated
> version from the referenced desktop file
>
>
>

--
This is me doing some advertisement for my blog http://seilo.geekyogre.com

Revision history for this message
Patryk Zawadzki (patrys) wrote :

Seif:

Never heard of anyone getting an "easy olympics medal". Also "easy" makes it sound like if a baby could do it. How would you feel when presented with "contratulations on taking just under a month to unlock this trivial achievement"?

Revision history for this message
Seif Lotfy (seif) wrote :

but if he unlocked it once why should he be able to unlock it again
lets say we award some1 for using project hamster the first time
what is the trophy for that

On Tue, Aug 24, 2010 at 4:04 PM, Patryk Zawadzki <email address hidden>wrote:

> Seif:
>
> Never heard of anyone getting an "easy olympics medal". Also "easy"
> makes it sound like if a baby could do it. How would you feel when
> presented with "contratulations on taking just under a month to unlock
> this trivial achievement"?
>
> --
> XML application problems
> https://bugs.launchpad.net/bugs/622718
> You received this bug notification because you are a member of OMG!,
> which is subscribed to omg.
>
> Status in OMG!: New
>
> Bug description:
> The XML branch of OMG commits to a number of really bad practices:
>
> * you go with Pascal/Java-style "CamelCase" where XML calls for
> "hyphenated-names" or classic "camelCasing"
> * you use elements for atomic types where best practices call for an
> attribute (ie. "<trophy priority="2">)
> * you've invented your own translation format ignoring the fact that
> intltool comes with out-of-the-box support for XML files
> * you reference and import "xsi" and "xsd" namespaces despite not using
> any of them
> * you provide your own schema for no apparent reason, you never reference
> it
> * title is not translatable
> * the "friendly application name" is redundant as you can get a translated
> version from the referenced desktop file
>
>
>

--
This is me doing some advertisement for my blog http://seilo.geekyogre.com

Revision history for this message
tm (toms-baugis) wrote :

http://www.woosk.com/wp-content/uploads/2009/06/no-pony-for-you.jpg

this bug is not about gnome achievements - it's about the issues in the omg schema. nor we are doing any form of haggling. the application is so simple that my teeth start to ache when i see this discussion that has now 14 comments already.

what you saying is, is that all the other differences do not matter. so why not just take the XML application as suggested by gnome achievements and add to it the set field/tag/whatever?

the problem is not in having extra fields. the problem is having two names for same thing, from a service implementation perspective.

and as for bronze/silver/gold versus easy/normal/difficult - i suggest taking into account the achievement systems that are out there already ps3, xbox, valve, others instead of inventing your own wheel.

Now, where did i put my sets... i swear they were here just a second ago!

Revision history for this message
tm (toms-baugis) wrote :

re #14 - trophies are unlocked just once.

Revision history for this message
Patryk Zawadzki (patrys) wrote :

Seif:

I don't know what the question is. How did you get the idea of being able to unlock something more than once?

Revision history for this message
Seif Lotfy (seif) wrote :

So once you achieve a bronze you can not achieve the gold of the same
torphy?

On Tue, Aug 24, 2010 at 4:31 PM, Patryk Zawadzki <email address hidden>wrote:

> Seif:
>
> I don't know what the question is. How did you get the idea of being
> able to unlock something more than once?
>
> --
> XML application problems
> https://bugs.launchpad.net/bugs/622718
> You received this bug notification because you are a member of OMG!,
> which is subscribed to omg.
>
> Status in OMG!: New
>
> Bug description:
> The XML branch of OMG commits to a number of really bad practices:
>
> * you go with Pascal/Java-style "CamelCase" where XML calls for
> "hyphenated-names" or classic "camelCasing"
> * you use elements for atomic types where best practices call for an
> attribute (ie. "<trophy priority="2">)
> * you've invented your own translation format ignoring the fact that
> intltool comes with out-of-the-box support for XML files
> * you reference and import "xsi" and "xsd" namespaces despite not using
> any of them
> * you provide your own schema for no apparent reason, you never reference
> it
> * title is not translatable
> * the "friendly application name" is redundant as you can get a translated
> version from the referenced desktop file
>
>
>

--
This is me doing some advertisement for my blog http://seilo.geekyogre.com

Revision history for this message
Patryk Zawadzki (patrys) wrote :

No, the trophies are divided by the level of commitment it takes to unlock them. In the same spirit that getting a bronze medal is easier than getting a gold one but neither of them is what one would call a piece of cake. There is also place for a platinum trophy for unlocking all the other trophies (which means you have "mastered" an application).

This was all modelled after existing trophy/achievement solutions out there in the games market. Both me and Toms are addicted gamers.

Revision history for this message
Seif Lotfy (seif) wrote :

can u give ma a better example

On Tue, Aug 24, 2010 at 5:06 PM, Patryk Zawadzki <email address hidden>wrote:

> No, the trophies are divided by the level of commitment it takes to
> unlock them. In the same spirit that getting a bronze medal is easier
> than getting a gold one but neither of them is what one would call a
> piece of cake. There is also place for a platinum trophy for unlocking
> all the other trophies (which means you have "mastered" an application).
>
> This was all modelled after existing trophy/achievement solutions out
> there in the games market. Both me and Toms are addicted gamers.
>
> --
> XML application problems
> https://bugs.launchpad.net/bugs/622718
> You received this bug notification because you are a member of OMG!,
> which is subscribed to omg.
>
> Status in OMG!: New
>
> Bug description:
> The XML branch of OMG commits to a number of really bad practices:
>
> * you go with Pascal/Java-style "CamelCase" where XML calls for
> "hyphenated-names" or classic "camelCasing"
> * you use elements for atomic types where best practices call for an
> attribute (ie. "<trophy priority="2">)
> * you've invented your own translation format ignoring the fact that
> intltool comes with out-of-the-box support for XML files
> * you reference and import "xsi" and "xsd" namespaces despite not using
> any of them
> * you provide your own schema for no apparent reason, you never reference
> it
> * title is not translatable
> * the "friendly application name" is redundant as you can get a translated
> version from the referenced desktop file
>
>
>

--
This is me doing some advertisement for my blog http://seilo.geekyogre.com

Revision history for this message
Patryk Zawadzki (patrys) wrote :
Revision history for this message
tm (toms-baugis) wrote :
Revision history for this message
Seif Lotfy (seif) wrote :

huh?

On Tue, Aug 24, 2010 at 6:09 PM, tm <email address hidden> wrote:

> http://2.bp.blogspot.com/_D_Z-
> D2tzi14/S8TE6VFyd_I/AAAAAAAACvo/Ki1d_7YPbAk/s1600/ALOT10.png
>
> --
> XML application problems
> https://bugs.launchpad.net/bugs/622718
> You received this bug notification because you are a member of OMG!,
> which is subscribed to omg.
>
> Status in OMG!: New
>
> Bug description:
> The XML branch of OMG commits to a number of really bad practices:
>
> * you go with Pascal/Java-style "CamelCase" where XML calls for
> "hyphenated-names" or classic "camelCasing"
> * you use elements for atomic types where best practices call for an
> attribute (ie. "<trophy priority="2">)
> * you've invented your own translation format ignoring the fact that
> intltool comes with out-of-the-box support for XML files
> * you reference and import "xsi" and "xsd" namespaces despite not using
> any of them
> * you provide your own schema for no apparent reason, you never reference
> it
> * title is not translatable
> * the "friendly application name" is redundant as you can get a translated
> version from the referenced desktop file
>
>
>

--
This is me doing some advertisement for my blog http://seilo.geekyogre.com

Revision history for this message
tm (toms-baugis) wrote :
Revision history for this message
Seif Lotfy (seif) wrote :

ok i will see what the boys think on this
other than that what do u think of the UI ideas :)

On Tue, Aug 24, 2010 at 6:55 PM, tm <email address hidden> wrote:

> ah, sorry, wrong link. here is the right one:
>
> http://1.bp.blogspot.com/_D_Z-D2tzi14/S8TONhrAPgI/AAAAAAAACvw/zTQ0fyvjAy8/s1600/ALOT11.png
>
> --
> XML application problems
> https://bugs.launchpad.net/bugs/622718
> You received this bug notification because you are a member of OMG!,
> which is subscribed to omg.
>
> Status in OMG!: New
>
> Bug description:
> The XML branch of OMG commits to a number of really bad practices:
>
> * you go with Pascal/Java-style "CamelCase" where XML calls for
> "hyphenated-names" or classic "camelCasing"
> * you use elements for atomic types where best practices call for an
> attribute (ie. "<trophy priority="2">)
> * you've invented your own translation format ignoring the fact that
> intltool comes with out-of-the-box support for XML files
> * you reference and import "xsi" and "xsd" namespaces despite not using
> any of them
> * you provide your own schema for no apparent reason, you never reference
> it
> * title is not translatable
> * the "friendly application name" is redundant as you can get a translated
> version from the referenced desktop file
>
>
>

--
This is me doing some advertisement for my blog http://seilo.geekyogre.com

Changed in omg:
status: New → Opinion
assignee: nobody → braulioareis (braulioareis)
Changed in omg:
assignee: braulioareis (braulioareis) → nobody
status: Opinion → New
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.