?
Solved

Layered Architecture Confusion

Posted on 2004-04-07
5
Medium Priority
?
233 Views
Last Modified: 2010-04-17
This question relates to the Layered Architecture pattern and to OOA/D in general. I hope I have posted it in the right area!

I am new to OOA/D and patterns (including the layers pattern). I am developing a computerised log book system in .NET using layers, in other words I am using an access db (data layer), I have a domain layer, and I am using Windows forms for the presentation layer.

The log book system is used to keep track of photographic films that have been dropped into a shop for processing. The user of the system must select the type of photographic developement service for the film from a list of available services, and then select the appropriate service options. Each service has one or more service options. When the user selects a particular photographic development service, I need the presentation layer (i.e. the windows form) to then display the appropriate service options in a suitable format. For example some service options might be represented by checkboxes, some might be textboxes, and some might be comboboxes.

What is the best way to go about this, bearing in mind that I do not want to couple the presentation layer to the domain layer too tightly. I have had it suggested to me that I should be looking to implement a data-driven approach, but I don't really know what this means.

Any help would be greatly appreciated.


Kind Regards,
Brad
0
Comment
Question by:bradwebber
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
5 Comments
 
LVL 6

Expert Comment

by:mmusante
ID: 10776142
I usually solve problems like this by adding a field to the DB table (service options) that describe with a code the datatype of the record (for example 0=boolean 1=text 2=numeric...), then the GUI code choose the right control based on this datatype code (for example 0=checkbox, 1=textbox 2=textbox ...)

... hope this can help you ...
0
 

Author Comment

by:bradwebber
ID: 10778718
Hi there mmusante,

How would I represent something like a combo box with three or four entries though? A service option would correspond to an entry in the combox, but how would the gui know which combobox to assign the service option to (assuming there was more than one combobox)???
0
 
LVL 6

Accepted Solution

by:
mmusante earned 1200 total points
ID: 10781326
I suggest to store the comboitems in your DB in a table like this:

idCombo INTEGER   \   Unique index  with both fields
ItemText VARCHAR /

and then store the idCombo in a field of the the "service options" table when the datatye is the code for 'combo'

you can pass to the presentation layer a list with the comboitems and use it to dynamically fill the combo
0

Featured Post

Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A short article about problems I had with the new location API and permissions in Marshmallow
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
Six Sigma Control Plans

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question