yohang / Finite

A Simple PHP Finite State Machine
http://yohan.giarel.li/Finite
MIT License
1.31k stars 188 forks source link

[Symfony bundle configuration] different name and value for the persistence #14

Open liuggio opened 11 years ago

liuggio commented 11 years ago

Should be better decouple the value of the state from its name, the value could have different type from the name eg number.

eg:

      draft:
          type:       initial
          value: 100    # this is the value that will be stored into the db
          properties:
              deletable: true
              editable: true
      enabled:
          type:       initial
          value: 200   # this is the value that will be stored into the db
          properties:
              printable: true
              editable: true 

The name could advantage the readability, instead the value could be a number. This could be very good for legacy Classes that have unreadable state code.

yohang commented 10 years ago

Big :+1: for this, as I perfectly know this use case, in legacy classes too.

Do you want to work on the implementation ?