Dofactory.com
Dofactory.com
 Back to list
Views:   7.6K
Replies:  2
Archived

Business Object properties: model as Objects or Enums?

If I want to represent status types ie

1 started
2 inprogress
3 completed
etc.

I know I can use Enum's in normal code but how should i represent them in the business objects layer, as objects or as enums, I am thinking about whether to use static classes?

any advice would be appreciated.

A context example would be I have new job business object and it has a status of inprogress when retrieved.

Hope this makes sense?

thanks

ben brown, Jun 20, 2013
Reply 1
Create an Enum that contains all the possible status types. 
Enums are easy to create, easy to use, and easy to convert to and from a string. 

Good luck.
Walt Lynton, Aug 09, 2013
Reply 2
Ben:

My suggestion is to not use separate (static) classes or objects.  
Simply use an Enum or even better a String value String are easy to display and work equally well.

In my view, anything more than an Enum or String would be overkill.

Jacob
Jacob Tanner, Jul 11, 2013
Stay Inspired!
Join other developers and designers who have already signed up for our mailing list.
Terms     Privacy     Cookies       Do Not Sell       Licensing      
Made with    in Austin, Texas.  - vsn 44.0.0
© Data & Object Factory, LLC.