C++/VB - Best Practise - layers

Asked By Craig Lister
07-Feb-10 02:26 AM
Could someone tell me the common/best practise for a solution layout.
That is, I intend to develop a well designed 4 layered application
(WinForms, .Net 3.5, Database app). I have had the habit of putting
all the layers into one project, in one solution. But should I be
splitting the UI into a Windows Forms project, then add a new project
(Maybe a Class Library project) to the solution for the business
layer.. then a new project for the service layer, and a new layer for
the data access layer? So, the solution has 4 projects.

Hope someone can guide me in best practise.
EXEs
(1)
DLLs
(1)
WinForms
(1)
Database
(1)
Windows
(1)
Mozart
(1)
Mozartists
(1)
Modularity
(1)
  David Webber replied to Craig Lister
07-Feb-10 01:00 PM
I do not know about best practice, but I have a number of executables which
do similar things using common DLLs.

Each exe has its own menus and tool bars.
Otherwise most of the heavily windows-dependent stuff (drawing code,
dialogues, etc)   is in one DLL.
Font management stuff is in another
Utility code (including the maths) which uses the C-run-time but is
completely independent of Windows is in a lower level DLL.
MIDI event management is in another.

I find this clarifies my ideas on the program structure.  I find it helpful.

Dave
--
David Webber
Mozart Music Software
http://www.mozart.co.uk
For discussion and support see
http://www.mozart.co.uk/mozartists/mailinglist.htm
  Craig Lister replied to David Webber
07-Feb-10 06:54 PM
Thanks Dave. That's helpful. So, using separate projects (and
therefore, DLLs and EXEs) is a good way for managing code separation
and managability then. Also, if I decided to change my ideas to a web
based application, simply creating a new web application, and then
referencing my existing DLLs would be a simple task?

Sounds like the right way to go to me! :)
  David Webber replied to Craig Lister
08-Feb-10 01:25 PM
I have never written a Web application as such - but modularity is usually a
good idea in my book :-)

Dave

--
David Webber
Mozart Music Software
http://www.mozart.co.uk
For discussion and support see
http://www.mozart.co.uk/mozartists/mailinglist.htm
help
R" statically loads my unicode extension dll "E" * "E" itself statically loads two MBCS extension dlls written by a external vendor. Unfortunately, my regular DLL "R" (and hence, the two extension the problem be that "R" and "E" use the MFC90UD.DLL whereas the external extension dlls use "MFC90D.DLL"? Thanks mk VC MFC Discussions Windows 7 (1) Vista (1) FinishDlabDLL (1) SetupDlabDLL (1) AfxGetMainWnd (1) AfxLoadLibrary (1) LoadLibraryA (1) LoadLibraryW 1) Why not? Have you used Depends to check if all necessary DLLs are present? I do not see any immediate reason why it should not - but we app or get external vendors libs with the version that you are using. With Extension DLLs you are going to have issues immediately if different version of MFCs are used in figure out how to make this work in some other fashion, such as acquiring updated DLLs from the third party, or reverting everything to ANSI / MBCS. But on the whole, I also an application of an external vendor. It can be extended by registering plug-in dlls which then are loaded at startup. it is definitely an ANSI application. But it is D: \ Dlab90 \ eDaq.dll' 'DASYLAB.EXE': Loaded 'D: \ Dlab90 \ Logger.dll' 'DASYLAB.EXE': Loaded 'C: \ WINDOWS \ system32 \ MFC42D.DLL', Symbols loaded. 'DASYLAB.EXE': Loaded 'C: \ WINDOWS \ system32 \ MSVCRTD.DLL', Symbols loaded
out and need your helpful advice on: when my user application starts, it dependants (system DLLs) get loaded (if needed) and they get mapped in. When this takes place, how do one from %windir% \ system32 instead. Thank you in advance. Boba. Win32 Kernel Discussions GetModuleFileName (1) Windows 7 (1) LoadLibraryEx (1) Exception (1) Module (1) Bytes (1) XP (1) System DLL (1 do not see how the link could help me. Don't put copies of system DLLs in your app folder. Re. current directory: Looking in current directory is considered non-safe not present. - -pa em en The current directory is still searched by default even on Windows 7. SafeDllSearchMode affects which order the directories are searched but, unfortunately, it does not prevent in the CWD entirely but it is not set by default on any versions of Windows that exist today, AFAIK. i do not. others do. no it is not. yes. no from the system dir. @Pavel, i'm afraid you are right regarding not having those dlls in the app's folder at load time, but users are also clients and i ever faced this situation, you would know that what causes it is a problem w / windows itself: unfortunately, some system dlls' behavior depends on where the lib was loded from. i mean the case when cwd
it was design purely for WIN32 and never had to worry about the version of windows users had. That seem to change now. So I guess, the deeper questions and answers WPF over MFC? - - HLS VC MFC Discussions SQL Server (1) Visual Studio (1) Silverlight (1) Windows 7 (1) Office (1) Linux (1) Adobe (1) Perl (1) I am using the RC mvp_tips.htm WPF will take you away from managed world to .Net, which is managed. WinForms and now WPF are available in .Net and obviate the need to use MFC in migrate to .net). - - Ajay Thanks for the clear explanation. Whats the difference from WPF and WinForms. Would you say that MS is merging the .NET technologies anyway for MFC based code package, there will be some managed sub-system requirement when its recompiled under VS2010? - - HLS WinForms came originally with .Net. WPF is the newer framework. WinForms is now essentially not going to see enhancements(it will be still part of .net in VS2010. VS2010 has the VC6-style ClassWizard, a welcome-back addition. It also has Windows 7-oriented enhancements to MFC. And an MFC ribbon designer (for the ribbon that debuted machine to run it. Build times are pretty quick. MFC is a GUI framework, requiring Windows. WPF is a GUI framework requiring .NET. WinForms is another GUI framework requiring .NET. WPF
C++ / VB Hello, I have a text file called OS.txt that looks like this: Windows 2000 Professional 5.0 (2195) Windows 2000 Server 5.0 (2195) Windows 7 Professional 6.1 (7600) Windows 7 Professional 6.1 (7600) Windows 7 Professional 6.1 (7600) Windows 7 Professional 6.1 (7600 Windows 7 Ultimate 6.1 (7100) Windows NT 4.0 Windows NT 4.0 Windows Server 2003 5.2 (3790) Windows Server
Application C++ / VB I am planning to implement a small client / server application in a Windows environment, but I do not know where to start. The application is a simple(?) data how to do this. My dilemma is that I do not know what interfaces to Windows services / APIs to use, nor how to use them. Clearly, I have to perform some shared dataspace, file locks should do the job, and another approach is to use a database and issue SQL commands to it, so the server is something like SQL Server or readily adapted; however, if you do it multithreaded with every thread trying to update the database, the problems you have to solve are essentially those of writing servers that simply open get into updating records, you may well be much better off going to a full database system. Getting all this to work "right" is tedious, which is why database systems were invented. For example, what happens if the server crashes? What happens if you lose the connection to one of the clients while doing updates? Database systems have the notion of do not know how to get started on client / server more. Personally, if I had to do what you are suggesting, I'd head the database route. Everything that is complex has already been worked out in ways that would take