Need good design for startup project

M

moondaddy

I'm building a winforms app using vb.net 1.1 and have 3 basic tiers on the
client side. the UI, BLL and DAL. Currently everything is in one project
and at some point I'll parse it out to a separate project for each Tier.

Currently the startup object is Sub Main in the form called frmMain.
frmMain is open through the life of the application session. What happens
is from Sub Main it runs this code to get things started correctly:

Shared Sub Main()
Try
System.Windows.Forms.Application.EnableVisualStyles()
System.Windows.Forms.Application.DoEvents()
System.Windows.Forms.Application.Run(New frmMain)
Catch ex As Exception
ErrLog(ex)
End Try
End Sub

Then the Load event opens the login form before frmMain has a chance to be
visible. If the login succeeds, then frmMain continues to open. If the
login is canceled, then frmMain exits and the application quits.
============================
What I want to do is parse the login form into a new project and make that
the startup project. Then as the user logs in it can check for updates and
more easily replace any of the other DLLs (UI, BLL or DAL) with out having
to replace its self (if I left the login form as part of the UI exe then I
think it would be more difficult to upgrade the UI exe as it would have to
replace itself.).

I know there are new things coming available like no touch deployment, but
I'm thinking that this design will still make things easier down the road
when I use a better technology for automatic updates.

So my question is:
Can anyone give some advise on this strategy and; if frmMain is in the UI
dll rather than being in the startup project, how can I make the login form
go away and have frmMain persist as the main form through out the
application session?

Thanks.
 
J

Jeffrey Tan[MSFT]

Hi moondaddy,

Thanks for your post!!

Based on my understanding, you want to get some suggestion on how to
achieve dynamic update and how to create a startup form for login.

I think this is a design issue, which we have many options available.

For me, I think I can introduce one way:
We can leverage the ShadownCopy function of AppDomain and use it to provide
the update function. This technical is documented in Eric Gunnerson's
article:
"AppDomains and Dynamic Loading"
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dncscol/htm
l/csharp05162002.asp

In this architecture, we required 2 AppDomains, one is starup domain, which
we can place the Login form in. After login, we can leverage AppDomainSetup
class to invoke the second AppDomain, in which we can place the other
business logic. Also, with the Shadow copy function enabled, we can
naturally get the update function. For more information, you may refer to
that article.(There is also a sample project in that article)

Anyway, I think there should be some other good design options. I hope some
experience community members can share their thought on this. Thanks
=================================================================
Thank you for your patience and cooperation. If you have any questions or
concerns, please feel free to post it in the group. I am standing by to be
of assistance.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
J

Jeffrey Tan[MSFT]

Hi moondaddy,

Does my reply make sense to you? If you still need help on this issue,
please feel free to feedback. Thanks

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top