Click here to Skip to main content
15,892,072 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I've been looking a lot recently and I can not even find anything to lead me to the correct practice.
I have an application that has several "sub applications". I wonder if launch these sub applications as separate processes(exe files) and then have a controller that is responsible for listing, close, communicate (eg via IPC) these sub applications is a good practice?
Posted

No way should it be "multiple exes". Those would be different processes. Processes are well isolated; there are given separate address spaces (if one process tries to use the same pointer, it points to a different physical memory address, this is the isolation supported by hardware, paged memory). Process are primarily designed for isolation, not for collaboration which would required such a bottleneck as IPC.

[EDIT]

More exactly, in some relatively rare cases, using "multiple exes" could be an acceptable option. Reluctantly, I used such techniques myself. For example, to run some command-line OS utility which is hard or impossible to write from scratch or through any accessible API. But "multiple exes" technique is not suitable as a regular/mainstream approach to modularization.

(Credit to the comment by C Pallini below.)

[END EDIT]

Of course, you can, and, in many cases, you should use multiple threads. They are not isolated and should communicate using thread synchronization primitives.

Now, how about separate forms? It depends on the application. For majority of applications, even multiple forms is not the best idea. Majority of best application uses one main form, and, inside this main form, there are controls (say, panels) which play the same role as your separate forms. Look at the docked UI of Visual Studio, for a typical example. Much simpler UI is based on the TabControl class (there are different classes for Forms and for WPF).

Above, I didn't mean modal (pop-up) forms. Of course, they are separate be definition and don't count. But, in a well-styled single-form application, even the number of those modal forms should be limited. Most operations should be "non-linear" (I borrowed this term from the field of video editors), which means that the user can control almost any aspect of the application at any moment, not in any predefined order (as in "wizards"). Modal forms prevent modifying any states on other forms until the modal form is closed, so use them sparingly.

—SA
 
Share this answer
 
v5
Comments
CPallini 29-Oct-14 16:23pm    
My 5, because it contains good explanations.
However I disagree on your first point. It could be multiple executables. It all depends on the amount of communication required by the different processes.
Sergey Alexandrovich Kryukov 29-Oct-14 16:25pm    
Thank you, Carlo.
—SA
Sergey Alexandrovich Kryukov 29-Oct-14 16:29pm    
Well, as to "multiple executable", I can agree. More accurate answer would say "using multiple processes can be an acceptable solution in some relatively rare cases".
Would we agree on that?

I just added [EDIT] to my answer to clarify on that and credited your comment.

Thank you.
—SA
CPallini 29-Oct-14 16:49pm    
Yes, Chrome, for instance, works that way.
Sergey Alexandrovich Kryukov 29-Oct-14 18:03pm    
Really? All right, I don't mind :-), it may make a lot of sense.

Back to your point: those separate processes are just separate HTTP clients, they don't have to communicate one with another; well, almost. But then, If something goes wrong with one process, others are left intact. More overhead, but more reliability, in this sense.

—SA
No, you should go with multiple forms instead.
Multiple exe's or dlls are rarely used which are independent in there functionality
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 29-Oct-14 16:14pm    
In many, of not most application, better answer would be: "none". Neither exes nor forms should not be multiple. I explained it in my answer.
Exclusions can takes place. It depends on the application goals. For example, my own mail client has two "main forms" behaving like having equal rights: one for sending, one for receiving.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900