|
Fields can't be overridden and I suspect you would still need to make the method virtual in order to override it.
|
|
|
|
|
Hello,
I want to simulate simple UPnP device in C#. Something like light-bull or door. It's school project about intelligent houses. I was looking for something on web, but now i am a bit lost . Can somebody give me some advice, how to start?
|
|
|
|
|
|
Can anybody tell the exact use of design/design patterns in C#.
Let me come with an example, i am designing a software for processing different type of input files. My design will be like this.
I will have a baseclass
class BaseFileClass
{
protected void ProcessFile();
}
Then the derived classes
class XMLClass : BaseFileClass
{
public override void ProcessFile()
{
}
}
class CSVCLass: BaseFileClass
{
public override void ProcessFile()
{
}
}
class ExcelClass: BaseFileClass
{
public override void ProcessFile()
{
}
}
On the main
Base b = null;
if( isXMl)
{
b = new XMLCLass();
}
else if( isExcel)
{
b = new ExcelCLass();
}
else if( isCSV)
{
b = new CSVCLass();
}
b.ProcessFile();
What are the uses of this kind of a design??
My small attempt...
|
|
|
|
|
I think that would be the, "I don't know the Abstract Factory Pattern Pattern".
|
|
|
|
|
hi Thanks for the update... do not misunderstand my intention..
i am not asking about design patterns, but what is the exact use of this kind of design?
My small attempt...
|
|
|
|
|
You might as well read up on that pattern while you wait for more responses.
|
|
|
|
|
In some manage system, this design pettern can be used.
For example, according to the type of the login account to new the object. The normal user, manager.
|
|
|
|
|
That's not a design pattern... but it almost is.
|
|
|
|
|
|
You designed it. If you don't know what it is for throw it away and start over.
|
|
|
|
|
Instead telling this kind of comments let me know this thing..
My intention is to know 'all the advantages' of this kind of a design... I guess the following please add if you know anymore
1) the implementation of different file type class can be isolated to separate class
2) i can simply add a new file type into this system
3) There wont be any change in obj.ProcessFile() as it is a base pointer.
Pls add more to this
My small attempt...
|
|
|
|
|
True, except maybe for 2.
You may want to use plug-ins if you want a lot of flexibility.
|
|
|
|
|
A design should be evaluated based on how well it solves the problem. Without stating the exact problem you are trying to solve you can't know the advantages of one design over another. You also don't give an alternative design. Without an alternative to compare it against it has no advantage or disadvantage.
What is the advantage of an orange?
If the problem to solve is driving a nail and the alternative is a hammer there is no advantage. If the problem to solve is vitamin C intake and the alterntiave is a multi-vitamin, the advantages are taste and refreshment.
|
|
|
|
|
The main advantage is that you can treat XML and CSV files in the same way. By processing both types as BaseFileClass, you can use the same code for handling both subclasses.
This is a type of code reuse. It also makes the higher-level processing simpler, since it's independent of the details of your derived classes.
|
|
|
|
|
Like we use crystal report, design it and print the required data only.
Similar to this is it possible to print label from this software Zebra Designer pro.
If i create a label format from Zebra designer pro software and want to print.
Is it possible that we can print this from C# or any other way?
|
|
|
|
|
I was you I'd try and contact Zebra Technologies and ask them for help.
I mean, you need some information to do this, if they have any kind of API or some argument call to the exe file to do this.
Anyhow I'll be surprised if they give you any help with this. If I were you I'd place my hopes somewhere else, you can check this link:
- http://www.filesland.com/free/label-printing.html
Open source software can help you better.
Regards
|
|
|
|
|
Hi,
Few days back, I was asked how does GC checks for the references. Googled and found this great article http://msdn.microsoft.com/hi-in/magazine/bb985010(en-us).aspx which explains it in depth. Sill, the concept of Root is not clear to me.
Few questions I have.
- What is a root?
- Is it a memory or part of managed heap or something else?
- what does is contains, references/ pointers to objects initialized using new operator?
- Any link explaining it better?
Thanks in advance.
- Praveen
|
|
|
|
|
Re-read this paragraph from the article, it explains roots. And look at Figure2.
Every application has a set of roots. Roots identify storage locations, which refer to objects on the managed heap or to objects that are set to null. For example, all the global and static object pointers in an application are considered part of the application's roots. In addition, any local variable/parameter object pointers on a thread's stack are considered part of the application's roots. Finally, any CPU registers containing pointers to objects in the managed heap are also considered part of the application's roots.
Regards
David R
---------------------------------------------------------------
"Every program eventually becomes rococo, and then rubble." - Alan Perlis
The only valid measurement of code quality: WTFs/minute.
|
|
|
|
|
Regarding this statement in the article:
"There are very few good uses of resurrection, and you really should avoid it if possible."
Is there ever a good reason to use resurrection? Nothing comes to mind for me.
|
|
|
|
|
Timothy CIAN wrote: Is there ever a good reason to use resurrection?
Nothing comes to mind for me. However, Lazarus and Jesus might disagree.
Regards
David R
---------------------------------------------------------------
"Every program eventually becomes rococo, and then rubble." - Alan Perlis
The only valid measurement of code quality: WTFs/minute.
|
|
|
|
|
Hi dear friend
I want to create a model that destroyed the data to predict. But I do not know how many roles in the fuzzy algorithm is used .. Please help me.
Thank you very much.
modified on Saturday, July 3, 2010 2:32 AM
|
|
|
|
|
1) Your question is not clear; please give more details.
2) Never post your email address to any forum, unless you really like spam. If you get a reply, the forum will automatically send you an email - just like this one, in fact.
Did you know:
That by counting the rings on a tree trunk, you can tell how many other trees it has slept with.
|
|
|
|
|
thank you dear..
What rule is appropriate in the Sugeno method ?
|
|
|
|
|
Does anybody know where is some information about how to play wav files from Pocket PC using C# 2.0?
|
|
|
|