As instructed by the book, in Ch 10 (Building the Business Logic and Data Access Components), while creating the Data Access Component, I have started creating the Solution in VB
2005. I first added a Windows Application to the Solution (to act as the UI) and then added a New Project of Type 'Class Library' to the Solution. This Class Library would act as the Data Access Component (DAC).
Both Projects appear in the Solution Explorer - the Windows Application UI and the DAC.I also Built the DAC and observed that the DLL was successfully created in the relevant directory.
However, in the UI, when I tried to declare a variable of the DABase class, I found that Intellisense did not display the DAC Class Library. Thus, I am not able to refer to the DLL, at design time.
On the other hand, INSTEAD of ADDING the DLL to the UI solution, if I simply create a single Project of Type 'Windows Application' (to act as the UI) and then, for this project, ADD a REFERENCE to the DAC DLL, then everything works PERFECTLY - I am able to declare a variable of a Class in the DAC DLL, because it appears in the Intellisense window.
I have the following questions :
1. When the 1st approach is followed, why am I unable to refer to
the DAC DLL at design time ? In addition to adding the Class
Library Project to the UI Project, do I also have to add a
reference to the DLL ? The book doesn't mention this.
2. In the 1st place, why does the DAC DLL have to be ADDED to the UI
Project ? Is this preferred to adding a Reference to the DAC DLL?
Is this to simplify Deployment onto the Production environment,
which might be a different machine ?