whats the total number of ts in:
q: implementing command pattern in web application im looking to implement the command pattern in a web application (asp.net c#)... since the commands come in text format from the client, what is the best way to translate the string to a command object? should i use reflection? currently i just assume the command that comes in matches the file name of a user control. this is a bit of a hack.
rather than have a select case statement that says if string = dashboard then call dashboard.execute(), is there a pattern for working with commands that originate as strings?

a: you could use a hash table to map from input strings to execute methods.

a: the best way to do this in just about any app is to use an ioc container. then your command pattern looks something like: 
public static class commandlineactionfactory
{
    public static icommandlineaction getaction(string actionname)
    {
        if (actionname == null) throw new argumentnullexception(nameof(actionname));
        icommandlineaction ret = objectfactory.trygetinstance<icommandlineaction>(actionname);
        if (ret == null)
        {
            throw new argumentoutofrangeexception(nameof(actionname), $action {actionname} does not exist.);
        }
        return ret;
    }
}

[code is from a command line app but the pattern works for the web]
the huge advantage here is that you can take advantage of the ioc container to instantiate the handlers, including patching in their dependencies. also opens the door to stunts like runtime addition of plugins. 

a: this is a command pattern written for django 1.4
it can be used the following way:
    p = designpattern()
    imps = implementation.objects.filter(project=example)
    designpatterimplementationsm2mbind(p, imps) 

django application models.py file:
    class abstractm2mbindcommand(abstractcommand):
        
        realizes behaviour design pattern `command
        
        model = none
        model_m2m_field = none

        max_comma_separated_length = 1024

        bound_objects = models.commaseparatedintegerfield(max_length=max_comma_separated_length, null=true, blank=true, default=none)
        bound_objects_long = models.textfield(null=true, blank=true, default=none)

        class meta:
            abstract = true

        @classmethod
        def do(cls, model_instance, queryset_to_link):
            #assert isinstance(queryset_to_link, queryset)
            setattr(model_instance, cls.model_m2m_field, queryset_to_link)

            ids =  [u%d % item.pk for item in queryset_to_link]

            model_instance.save()

            fk_field = camel_to_underscore_convert(cls.model.__name__)

            cmd = cls()
            cmd.direction = cls.forward
            joined_ids = u,.join(ids)
            if len(joined_ids) > cls.max_comma_separated_length:
                cmd.bound_objects_long = joined_ids
                cmd.bound_objects = none
            else:
                cmd.bound_objects_long = none
                cmd.bound_objects = u,.join(ids)
            setattr(cmd, fk_field, model_instance)
            cmd.save()


        @classmethod
        def undo(cls, command_id):
            pass

         @classmethod
         def redo(cls, command_id):
             pass 


    class designpatterimplementationsbindcommand(abstractm2mbindcommand):
        model = designpattern
        model_m2m_field = implementations

        design_pattern = models.foreignkey(designpattern)


user
I counted two hundred and thirty-four "t"s in that text.
assistant