By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,903 Members | 1,670 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,903 IT Pros & Developers. It's quick & easy.

DLL vs Dynamic Compile

P: n/a
Currently I'm working on a C# app for a large organization (700 users
nationwide). This App is still under development. I have setup code in my
App to pull C# source code from a database and dynamically compile it at
runtime. All source code stored in the database will be of Type Form and all
forms will load as children of an MDI. Once I compile the code I store it on
the local machine as a DLL. I do this so that the next time a user on that
local machine elects to use a form, I check to see if that form exists
locally in a DLL first. If it does I load it from the local DLL and cut down
on both load time and network traffic. I also check to see if there are
newer versions of the code in the DB and will pull/recompile as needed.

My question is: Can anyone give me pros/cons to storing either the C# code
in the database or the already compiled DLL's? I could circumvent the need
to compile on the fly if I stored the DLL's direct, but I'm not sure I
recognize all the pros/cons to doing it either way. I do know that the DLL's
are larger than the raw source code so network traffic would be up slightly.
I think this would be nominal at best though.

Any thoughts/suggestion on storing raw source or a DLL would be greatly
appreciated.

Security?
Speed?
Preference?

Thanks,
John F
Nov 17 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a

IMHO I'd store the compiled .DLL. 700 users grabbing an updated .DLL a few
times a years seems like a small price to pay in order to keep source code
out of sight. If bandwidth is that big of an issue then perhaps you could
compress/decompress the .DLL - there are freeware compression APIs - I think
one is called "ZipLib"??

Also I'm assuming that your compiled C# .DLL contains IL, not native
compiled code. If so then .NET will version check the IL and recompile it
before executing if you replace a .DLL with a newer one...

"John F" wrote:
Currently I'm working on a C# app for a large organization (700 users
nationwide). This App is still under development. I have setup code in my
App to pull C# source code from a database and dynamically compile it at
runtime. All source code stored in the database will be of Type Form and all
forms will load as children of an MDI. Once I compile the code I store it on
the local machine as a DLL. I do this so that the next time a user on that
local machine elects to use a form, I check to see if that form exists
locally in a DLL first. If it does I load it from the local DLL and cut down
on both load time and network traffic. I also check to see if there are
newer versions of the code in the DB and will pull/recompile as needed.

My question is: Can anyone give me pros/cons to storing either the C# code
in the database or the already compiled DLL's? I could circumvent the need
to compile on the fly if I stored the DLL's direct, but I'm not sure I
recognize all the pros/cons to doing it either way. I do know that the DLL's
are larger than the raw source code so network traffic would be up slightly.
I think this would be nominal at best though.

Any thoughts/suggestion on storing raw source or a DLL would be greatly
appreciated.

Security?
Speed?
Preference?

Thanks,
John F

Nov 17 '05 #2

P: n/a

"John F" <jf@rt.com> wrote in message
news:91**********************************@microsof t.com...
Currently I'm working on a C# app for a large organization (700 users
nationwide). This App is still under development. I have setup code in
my
App to pull C# source code from a database and dynamically compile it at
runtime. All source code stored in the database will be of Type Form and
all
forms will load as children of an MDI. Once I compile the code I store it
on
the local machine as a DLL. I do this so that the next time a user on
that
local machine elects to use a form, I check to see if that form exists
locally in a DLL first. If it does I load it from the local DLL and cut
down
on both load time and network traffic. I also check to see if there are
newer versions of the code in the DB and will pull/recompile as needed.

My question is: Can anyone give me pros/cons to storing either the C# code
in the database or the already compiled DLL's? I could circumvent the
need
to compile on the fly if I stored the DLL's direct, but I'm not sure I
recognize all the pros/cons to doing it either way. I do know that the
DLL's
are larger than the raw source code so network traffic would be up
slightly.
I think this would be nominal at best though.

Any thoughts/suggestion on storing raw source or a DLL would be greatly
appreciated.

Security?
Speed?
Preference?


You are going to want to store the compiled binaries for all these reasons.
Speed and security right off, there are reasons to prefer binaries:

-A compiled assembly has an AssemblyVersion burned into it, while source
code does not.
-A compiled assembly can be compiled from any number of source files.
-A compiled assembly can be signed, and loading compiled, signed, safe
assemblies can be done in a low-trust context.
David
Nov 17 '05 #3

P: n/a
Thanks David
--
John F
"David Browne" wrote:

"John F" <jf@rt.com> wrote in message
news:91**********************************@microsof t.com...
Currently I'm working on a C# app for a large organization (700 users
nationwide). This App is still under development. I have setup code in
my
App to pull C# source code from a database and dynamically compile it at
runtime. All source code stored in the database will be of Type Form and
all
forms will load as children of an MDI. Once I compile the code I store it
on
the local machine as a DLL. I do this so that the next time a user on
that
local machine elects to use a form, I check to see if that form exists
locally in a DLL first. If it does I load it from the local DLL and cut
down
on both load time and network traffic. I also check to see if there are
newer versions of the code in the DB and will pull/recompile as needed.

My question is: Can anyone give me pros/cons to storing either the C# code
in the database or the already compiled DLL's? I could circumvent the
need
to compile on the fly if I stored the DLL's direct, but I'm not sure I
recognize all the pros/cons to doing it either way. I do know that the
DLL's
are larger than the raw source code so network traffic would be up
slightly.
I think this would be nominal at best though.

Any thoughts/suggestion on storing raw source or a DLL would be greatly
appreciated.

Security?
Speed?
Preference?


You are going to want to store the compiled binaries for all these reasons.
Speed and security right off, there are reasons to prefer binaries:

-A compiled assembly has an AssemblyVersion burned into it, while source
code does not.
-A compiled assembly can be compiled from any number of source files.
-A compiled assembly can be signed, and loading compiled, signed, safe
assemblies can be done in a low-trust context.
David

Nov 17 '05 #4

P: n/a
Thanks Richard
--
John F
"Richard" wrote:

IMHO I'd store the compiled .DLL. 700 users grabbing an updated .DLL a few
times a years seems like a small price to pay in order to keep source code
out of sight. If bandwidth is that big of an issue then perhaps you could
compress/decompress the .DLL - there are freeware compression APIs - I think
one is called "ZipLib"??

Also I'm assuming that your compiled C# .DLL contains IL, not native
compiled code. If so then .NET will version check the IL and recompile it
before executing if you replace a .DLL with a newer one...

"John F" wrote:
Currently I'm working on a C# app for a large organization (700 users
nationwide). This App is still under development. I have setup code in my
App to pull C# source code from a database and dynamically compile it at
runtime. All source code stored in the database will be of Type Form and all
forms will load as children of an MDI. Once I compile the code I store it on
the local machine as a DLL. I do this so that the next time a user on that
local machine elects to use a form, I check to see if that form exists
locally in a DLL first. If it does I load it from the local DLL and cut down
on both load time and network traffic. I also check to see if there are
newer versions of the code in the DB and will pull/recompile as needed.

My question is: Can anyone give me pros/cons to storing either the C# code
in the database or the already compiled DLL's? I could circumvent the need
to compile on the fly if I stored the DLL's direct, but I'm not sure I
recognize all the pros/cons to doing it either way. I do know that the DLL's
are larger than the raw source code so network traffic would be up slightly.
I think this would be nominal at best though.

Any thoughts/suggestion on storing raw source or a DLL would be greatly
appreciated.

Security?
Speed?
Preference?

Thanks,
John F

Nov 17 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.