tags:

views:

18

answers:

0

Hi,

How would you implement a reusable gui framework or such in a DDD environment that acts as both search and input?

Example: MVP-architecture

Entity - Person
 - Name
 - Age
 - JoinDate
 - etc.

GUI - PersonView (input)
 - Name (TextBox, accepts string input)
 - Age (TextBox, accespt integer input)
 - JoinDate (DateTimePicker)
 - etc.

GUI - PersonSearchView (search)
 - Name (TextBox, accepts string input)
 - Age (TextBox, accepts STRING INPUT)
 - JoinDate (modified DataTimePicker, accespts STRING INPUT)
 - etc.

Now the tricky part, on the search view, controls should behave differently from the input view.

Eg. I want to be able to write inside Age: 10..20 or something to indicate a range.

There needs to be some other Entity type than person becuase Age is of type integer and the input is of type string, how can I reuse as much as possible from all MVP-parts?

Is this a bad idéa to try to reuse GUI-views for both input and search or how could I wrap this up in a nice way?