I'm usually a C# developer, but writing a mostly-client side application using jQuery.
It is reasonably straight forward: I have a list of "groups" which have some parameters (like a group name) and a list of "users" who also have some parameters.
At the moment I try to manage that using a <li>
with a specific id, so there is a lot of string-matching involved to turn <li id="group-2">Name - ExtraInfo</li>
back into something I can work with.
I feel that this approach is stupid because a) I use the UI as back-end for state and b) I rely on string parsing rather than working with real objects.
In C# I would just create a DTO (essentially a List<Group>
), but I have not enough experience in JavaScript/jQuery to do that there.
Can someone give me some quick tips how to create a custom object and manage a list of these?