|
in may case the base class have not a parameterless constructor, while in the derived I need this one.
Is it possible to istantiate the base class in later mathod?
|
|
|
|
|
Not by using inheritance - you would need to use a wrapper as in my second snippet, the base would stay null until instanciated.
|
|
|
|
|
You cannot do it later in a method, but if you know the parameters, you can do it like this:
class BaseClass
{
public BaseClass(int theParam)
{
}
}
class DerivedClass : BaseClass
{
public DerivedClass() : base(4711)
{
}
}
|
|
|
|
|
Hello experts,
First of all I have average experience with .Net programming, so please go easy on me .
I have an windows application project that consists of 10 Forms. At the moment when I compile my app, it generates a single Exe file. Everything works good.
I want to write an update program for my application, and also after reading some best practices on how to build your app i realized I also need a lot of code rewriting in order to make my app look good.
The thing is I am thinking it would be better to split each form into a separate DLL file, this way achieving some form of modular structure and make my app easier to manage and update.
The problem is I don't have enough experience to know whether splitting each Form into a separate DLL is a good idea or a bad idea, so I'm asking you guys to tell me, from your experience, how would you structure such a project and what would the expected files be ?.
Thank you for your time, and I hope I made myself understood.
Andrei
|
|
|
|
|
In general, you won't see any benefit from splitting the forms out into separate DLLs. When you read about modularisation, people tend to be talking about splitting out application logic, rather than the presentation tier. So, you can split out the actual logic, which is fine, but you should leave the forms where they are.
|
|
|
|
|
Thank you for the answer.
I will give this some more though. Each form I have is part of a module of the application logic.
So I thought it would be recommended to split them into DLL's or more experienced programmers would split the forms at presentation level too.
Maybe I will just leave it as it is, because it is working fine so far and I will write an update program that overwrites the entire exe file instead of particular DLL files.
-
Andrei
|
|
|
|
|
10 forms is fairly small as apps go, I'd leave it in the single exe. It is usual to divorce the UI from the business logic and the database functions. I'd assume that all your business logic is in the code behind the form, this is usually extracted into a separate class.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
How to convert PPT to image without using MS Office , Can we do it with Open Office ?
I did it with MS-Office but it need to be installed Ms-Office on Server.
POWERPOINT.Application App = new Microsoft.Office.Interop.PowerPoint.Application();
POWERPOINT.Presentation pres = App.Presentations.Open(fileName, OFFICECORE.MsoTriState.msoTrue, OFFICECORE.MsoTriState.msoFalse, OFFICECORE.MsoTriState.msoFalse);
int pageNo = 0;
pres.SaveAs(imagePath + "\\Images", POWERPOINT.PpSaveAsFileType.ppSaveAsPNG, OFFICECORE.MsoTriState.msoFalse);
|
|
|
|
|
Hi..
how to report the single record into crystal report ..
here i am enter user id in text box then display the user information in crystal report based on the user id....
please give me ans..
|
|
|
|
|
You question is too broad, get a tutorial on Crystal Reports and work through it.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Say my performance is approx 50ms per request (request initiated from one port on local machine to another port SAME machine), each request contains about ten rows of data (2 columns only).
What's your thought on this performance level?
(I know some algo trading execution say from London to NY can be done in say 50-60ms ...)
dev
|
|
|
|
|
Is this a C# issue?
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
it's not an issue, just testing water see how people feels about 50ms per call if it's considered slow/acceptable/fast
dev
|
|
|
|
|
|
i did thought of that but it's a programming question - question for an opinion on a general IPC performance - in particular, for those .NET developers who has tried to push performance on IPC/socket
dev
|
|
|
|
|
devvvy wrote: question for an opinion on a general IPC performance Which has nothing to do with C#.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
dude, there isn't a forum by the name "Socket" or ".NET IPC", so this i figure is the closest.
dev
|
|
|
|
|
You could have chosen this[^] forum, or this[^] one. Richard is right - as your question doesn't have any code element, i.e. you haven't actually asked why your code is slow, then it's not for this forum. Your question is more general and, dare I say it, architectural.
|
|
|
|
|
i see, you are correct Peter, in absence of C# code, this is an architectural issue
dev
|
|
|
|
|
And neither "Socket" nor "NET.IPC" are specific to C#.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
The question isn't really valid. What is acceptable for your app depends on your requirements, not some general opinion.
|
|
|
|
|
no, if you wire one simple request with a small payload and it takes one second, we know "Something is Wrong", regardless of your application.
In fact I think fact our code now do one request in 50ms local-to-local tells me it's not tuned enough
dev
|
|
|
|
|
As others have said, you're asking for other peoples opinion about what is acceptable performance for a single request. We REALLY can't answer that. Only your requirements can.
Then, you toss all of that discussion and replace other opinions with what YOUR opinion is and that the performance is unacceptable. You answered your own question!
Now, if you're asking about how to improvie your code performance, you can restate your question and supply the relevant code snippets to show what you've got.
|
|
|
|
|
|
Reported as abusive.
Have a nice life.
|
|
|
|