Solved

Layered Architecture Confusion

Posted on 2004-04-07
5
223 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
  • 2
5 Comments
 
LVL 6

Expert Comment

by:mmusante
Comment Utility
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
Comment Utility
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
Comment Utility
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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
A short article about a problem I had getting the GPS LocationListener working.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
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…

743 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now