Are DLLs redundant in .NET?
-
So, how are you going to share your reusable code? Executables? Or are you going to cut and paste? Oh, and if you're adding a reference to something like a standard .NET assembly guess what, that's a DLL? Simply, a DLL is a convenient way to share functionality.
Pete O'Hanlon wrote:
how are you going to share your reusable code?
The same way, but as an EXE with some sort of helpful library-specific functionality in the
main
. :shrug: -
Dave Kreskowiak wrote:
make your code monolithic by including it in larger .EXE's
That's not what he means.
I know. I was just pointing out that some people can go overboard with the ILMerge tool and end up making an .EXE that's 10's or 100's of MB in size. Then they wonder why it takes so long to load.
A guide to posting questions on CodeProject
Click this: Asking questions is a skill. Seriously, do it.
Dave Kreskowiak -
Why would you want to make your code monolithic by including it in larger .EXE's, thereby increasing load time? Why would you want to give the users the ability to launch a "library" .EXE that does nothing but return to the command prompt?
A guide to posting questions on CodeProject
Click this: Asking questions is a skill. Seriously, do it.
Dave Kreskowiak -
What do you mean by "tested and verified themselves"??
A guide to posting questions on CodeProject
Click this: Asking questions is a skill. Seriously, do it.
Dave Kreskowiak -
What do you mean by "tested and verified themselves"??
A guide to posting questions on CodeProject
Click this: Asking questions is a skill. Seriously, do it.
Dave Kreskowiak -
By wrapping everything in an executable you're just adding extra dead weight.
A guide to posting questions on CodeProject
Click this: Asking questions is a skill. Seriously, do it.
Dave Kreskowiak -
Say, main() by default was required to call a bunch of test suites that executed unit tests. I once worked somewhere where they did this btw.
Soooo, you're going to ship your unit tests with the code to the customer? That sounds stupid. That's like shipping the Paint Shop from the assembly plant with the car that it built.
A guide to posting questions on CodeProject
Click this: Asking questions is a skill. Seriously, do it.
Dave Kreskowiak -
By wrapping everything in an executable you're just adding extra dead weight.
A guide to posting questions on CodeProject
Click this: Asking questions is a skill. Seriously, do it.
Dave Kreskowiak -
Soooo, you're going to ship your unit tests with the code to the customer? That sounds stupid. That's like shipping the Paint Shop from the assembly plant with the car that it built.
A guide to posting questions on CodeProject
Click this: Asking questions is a skill. Seriously, do it.
Dave KreskowiakSounds more like including the diagnostic reader device with the car rather than requiring a visit to the shop when the check engine light comes on.
-
Soooo, you're going to ship your unit tests with the code to the customer? That sounds stupid. That's like shipping the Paint Shop from the assembly plant with the car that it built.
A guide to posting questions on CodeProject
Click this: Asking questions is a skill. Seriously, do it.
Dave Kreskowiak -
It's not constant as the sizes of various tables in the resulting .EXE change depending on what is in the .EXE.
A guide to posting questions on CodeProject
Click this: Asking questions is a skill. Seriously, do it.
Dave Kreskowiak -
My thinking was along similar lines i.e. writing small executables that did one thing but did it well a la UNIX. Except I would require that the default behaviour of a main() function was to run a test suite embedded in the assembly.
You can have a static
int Test(string[] args)
for that (unless you plan on using debug, vs stdout). Call it with the help of a shell-extension or external command that loads the assembly and executes your custom entrypoint :rolleyes:Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]
-
By wrapping everything in an executable you're just adding extra dead weight.
A guide to posting questions on CodeProject
Click this: Asking questions is a skill. Seriously, do it.
Dave Kreskowiak -
Sounds more like including the diagnostic reader device with the car rather than requiring a visit to the shop when the check engine light comes on.
When was the last time you executed unit tests on customer site? I've written seperate tools to diagnose database problems, but never to verify "the code". If the .EXE gets corrupted, chances are good it won't even run, and if it is corrupted, chances are good you've got hardware problems.
A guide to posting questions on CodeProject
Click this: Asking questions is a skill. Seriously, do it.
Dave Kreskowiak -
Or a compiler that bootstraps and tests itself? Or an installable that operations can't fuck up? There are always reasons for questions ;-)
CatchExAs wrote:
Or a compiler that bootstraps and tests itself?
Really? How often do you see that and how often are you going to use it?
CatchExAs wrote:
Or an installable that operations can't f*** up?
Depending on what you mean by "operations", yeah, right. If you're talking about people, there's nothing they can't fuck up and there's always some situation that you're code isn't going to be able to recover from.
A guide to posting questions on CodeProject
Click this: Asking questions is a skill. Seriously, do it.
Dave Kreskowiak -
I know. I was just pointing out that some people can go overboard with the ILMerge tool and end up making an .EXE that's 10's or 100's of MB in size. Then they wonder why it takes so long to load.
A guide to posting questions on CodeProject
Click this: Asking questions is a skill. Seriously, do it.
Dave Kreskowiak+5 "Let's make a shared library out of that code" "Lets us ILMerge those" :omg: It is also done on the web, where they call it "packaging" or something like it. I wonder how many sites made me download a JQuery library that's already cached in the browser.
Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]
-
It's the startup code, import tables, data tables, blah, blah, blah for a Win32 executable, that a .DLL doesn't have, nor need. A .NET assembly in an .EXE is not 100% MSIL code. There is still unmanaged code in there to get the process running under the CLR.
A guide to posting questions on CodeProject
Click this: Asking questions is a skill. Seriously, do it.
Dave Kreskowiak -
When was the last time you executed unit tests on customer site? I've written seperate tools to diagnose database problems, but never to verify "the code". If the .EXE gets corrupted, chances are good it won't even run, and if it is corrupted, chances are good you've got hardware problems.
A guide to posting questions on CodeProject
Click this: Asking questions is a skill. Seriously, do it.
Dave KreskowiakI never write or execute unit tests at all, anywhere. I don't have the same concerns as the OP and I don't think we're talking about DLLs shipped with an application, but libraries provided to other developers for use in their applications -- like if I wrote an ISO 8601-compliant date handling library for example, but only distributed the DLL rather than the code. Personally, when I get a DLL from some third-party (an ADO.net provider perhaps) I don't like having to create a Solution and Project, then add a reference just so I can use the Object Explorer to see what's in it. It would be convenient if it were an EXE and running it would provide (version-specific) documentation and such (hopefully more accurate than what's available on the developer's website, if any). Additionally, the Object Explorer only says what's in there, not how to use it, no documentation. I suspect there must already be a tool that allows sort of a command-line Object Explorer, but I haven't looked. Certainly one could be written, but it still wouldn't provide everything that a custom baked-in tool would. Seeing that given a DLL with some (public) class C with a (public) method M that takes a string parameter S and returns a string is all well and good, but wouldn't it be convenient to immediately be able to execute:
somelib test C.M "hello world"
and have it report the result? Without having to access an IDE and write a simple test app just to see what it does? -
You can have a static
int Test(string[] args)
for that (unless you plan on using debug, vs stdout). Call it with the help of a shell-extension or external command that loads the assembly and executes your custom entrypoint :rolleyes:Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]
Having a separate console app that loads the Assembly would definitely be another way, but the only reason would be to simply remove the main, I don't see a big benefit.
-
+5 "Let's make a shared library out of that code" "Lets us ILMerge those" :omg: It is also done on the web, where they call it "packaging" or something like it. I wonder how many sites made me download a JQuery library that's already cached in the browser.
Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]
Oh, you've done SSIS too? :sigh: