Solved

Layered Architecture Confusion

Posted on 2004-04-07
5
228 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 300 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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

Suggested Solutions

A short article about a problem I had getting the GPS LocationListener working.
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

726 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