471,349 Members | 1,872 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,349 software developers and data experts.

C# code in DB?

Hi all

Is it possible to place parts of a C# application (code + GUI) in a
database like Oracle? The application should be a "thin client", i.e.
it does little else than getting code from the DB and executing it.
How do I do it? (Please no details, I am only evaluating the
possibilities, I'm not a C# crack yet.)

Thanks for your replies!
Peter
Jun 27 '08 #1
8 940
digory wrote:
Hi all

Is it possible to place parts of a C# application (code + GUI) in a
database like Oracle? The application should be a "thin client", i.e.
it does little else than getting code from the DB and executing it.
How do I do it? (Please no details, I am only evaluating the
possibilities, I'm not a C# crack yet.)

Thanks for your replies!
Peter
Since you can load assemblies from a byte array in memory or memory
stream, it's of course possible to do these things, provided you do them
right.

For instance, you might need to hook into the resolution mechanism of
the app domain to handle referenced assemblies, ie. you load assembly A
and ask for an object from it, which needs assembly B, that also needs
to be loaded from the database.

So yes, it's doable.

--
Lasse Vågsæther Karlsen
mailto:la***@vkarlsen.no
http://presentationmode.blogspot.com/
PGP KeyID: 0xBCDEA2E3
Jun 27 '08 #2
digory <di****@gmx.netwrote:
Is it possible to place parts of a C# application (code + GUI) in a
database like Oracle? The application should be a "thin client", i.e.
it does little else than getting code from the DB and executing it.
How do I do it? (Please no details, I am only evaluating the
possibilities, I'm not a C# crack yet.)
You can certainly put assemblies into databases, just as byte arrays
(just like you'd put pictures in, basically). You might need to think
carefully about the security involved, however - executing arbitrary
code is somewhat dangerous. You might want to use something like
public/private key signatures to make sure that the code you're going
to execute really is trustworthy.

--
Jon Skeet - <sk***@pobox.com>
Web site: http://www.pobox.com/~skeet
Blog: http://www.msmvps.com/jon.skeet
C# in Depth: http://csharpindepth.com
Jun 27 '08 #3
digory wrote:
Is it possible to place parts of a C# application (code + GUI) in a
database like Oracle? The application should be a "thin client", i.e.
it does little else than getting code from the DB and executing it.
How do I do it? (Please no details, I am only evaluating the
possibilities, I'm not a C# crack yet.)
It is possible.

But I do not like the approach.

The client app would be talking directly to the database
server. Database servers are usually less hardened than
web/app servers.

I do not see any benefits of having the code in the database.

It will require a lot of plumbing to get it working.

Arne
Jun 27 '08 #4
Thanks for your replies. Security is not a problem. The client app
talks to some middleware with a secure connection, the middleware is
in the same network as the database. The code that will be executed is
not arbitrary as nobody has access to the database except us. (There
would be a lot of more harmful things somebody could do if he had
access to the database.)

The reason why we would like to put C# code in the database is the
following: Our clients are hospitals, there are hundreds of computers.
If our application had to be reinstalled everytime we make a new
release, somebody had to go to all these computers, run the setup
application, etc., which is just not practical. Instead, our
application is designed as a thin client that gets code from the
server. Because the concept of the thin client is simple and robust,
it requires little modification over time, so new releases of the thin
client are rare. The actual code is in the DB, we can upload new
releases or even minor bugfixes at any time.
Jun 27 '08 #5
digory wrote:
Hi all

Is it possible to place parts of a C# application (code + GUI) in a
database like Oracle? The application should be a "thin client", i.e.
it does little else than getting code from the DB and executing it.
How do I do it? (Please no details, I am only evaluating the
possibilities, I'm not a C# crack yet.)

Thanks for your replies!
Peter
Hi there, you could place your assemblies (dlls) on a server and load
them dynamically from your thin client - I use this method in several of
my apps
Jun 27 '08 #6
If you're worried about the deployment process just write a web application
instead of a client app. I would avoid doing what you're doing at all costs,
even if it means more development time.

"digory" <di****@gmx.netwrote in message
news:07**********************************@d77g2000 hsb.googlegroups.com...
Thanks for your replies. Security is not a problem. The client app
talks to some middleware with a secure connection, the middleware is
in the same network as the database. The code that will be executed is
not arbitrary as nobody has access to the database except us. (There
would be a lot of more harmful things somebody could do if he had
access to the database.)

The reason why we would like to put C# code in the database is the
following: Our clients are hospitals, there are hundreds of computers.
If our application had to be reinstalled everytime we make a new
release, somebody had to go to all these computers, run the setup
application, etc., which is just not practical. Instead, our
application is designed as a thin client that gets code from the
server. Because the concept of the thin client is simple and robust,
it requires little modification over time, so new releases of the thin
client are rare. The actual code is in the DB, we can upload new
releases or even minor bugfixes at any time.
Jun 27 '08 #7
digory wrote:
Thanks for your replies. Security is not a problem. The client app
talks to some middleware with a secure connection, the middleware is
in the same network as the database. The code that will be executed is
not arbitrary as nobody has access to the database except us. (There
would be a lot of more harmful things somebody could do if he had
access to the database.)

The reason why we would like to put C# code in the database is the
following: Our clients are hospitals, there are hundreds of computers.
If our application had to be reinstalled everytime we make a new
release, somebody had to go to all these computers, run the setup
application, etc., which is just not practical. Instead, our
application is designed as a thin client that gets code from the
server. Because the concept of the thin client is simple and robust,
it requires little modification over time, so new releases of the thin
client are rare. The actual code is in the DB, we can upload new
releases or even minor bugfixes at any time.
You might want to reconsider frequent updates in a hospital or any other
healthcare environment. The cost of actually installing the software, even
if it has to be done by hand, would be miniscule compared to the
verfication/validation testing for safety, efficacy, and reliability.

Also, you could look at various deployment options which cache the code
locally, so losing a connection to the update server doesn't become a
catastrophe.
Jun 27 '08 #8
digory wrote:
Thanks for your replies. Security is not a problem. The client app
talks to some middleware with a secure connection, the middleware is
in the same network as the database. The code that will be executed is
not arbitrary as nobody has access to the database except us. (There
would be a lot of more harmful things somebody could do if he had
access to the database.)

The reason why we would like to put C# code in the database is the
following: Our clients are hospitals, there are hundreds of computers.
If our application had to be reinstalled everytime we make a new
release, somebody had to go to all these computers, run the setup
application, etc., which is just not practical. Instead, our
application is designed as a thin client that gets code from the
server. Because the concept of the thin client is simple and robust,
it requires little modification over time, so new releases of the thin
client are rare. The actual code is in the DB, we can upload new
releases or even minor bugfixes at any time.
I can still not see any reason to have in the database compared
to in the file system.

Have you evaluated click once as a possibility ?

Furthermore .NET is by default XCOPY deployable, so
they can very easily be upgraded.

Arne

Jun 27 '08 #9

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

51 posts views Thread by Mudge | last post: by
9 posts views Thread by bigoxygen | last post: by
4 posts views Thread by jason | last post: by
16 posts views Thread by Dario de Judicibus | last post: by
109 posts views Thread by Andrew Thompson | last post: by
18 posts views Thread by Joe Fallon | last post: by
171 posts views Thread by tshad | last post: by
reply views Thread by XIAOLAOHU | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.