|
Hi,
When to use patterns and practices?
I think it's used for architecture like 3 tier...
How to start using it?
I read on Microsoft that it's recommended arch. for .net projects but how to start using it?
|
|
|
|
|
A pattern is merely a recognition that certain types of problems have been dealt with in a certain fashion before and that this was a successful way of dealing with it. If you like, you can think of patterns as bricks which can be used to build an application.
Whenever you build an application, you should start off by thinking about the problem you're trying to solve. When you start to break it down, you'll be able to identify what patterns are appropriate.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys
|
|
|
|
|
|
Patterns are great for solving common problems. The only problem is a lot of the examples accompanying design pattern publications don't appear to be common problems in my eyes. I am writing some articles about design patterns at the mo. and I'm going to provide practical examples.
My first article is about the Implementing The State Software Design Pattern[^]. I will be writing many more!!
When I have a few Design Pattern articles in my blog I will create a new 'Design Patterns' header for them so they are easier to find.
Hope my blog will assist you.
Ps. Also, do a google for Extract Method, Extract Parameter. These are a couple of basic patterns that can be applied to code straight away.
|
|
|
|
|
Visual Studio 2005 CE (Windows CE 5.0) Emulator not listing even after installation
why ??
thanks
|
|
|
|
|
Hi,
I am using mmc in my application, when i dynamically refer a dll using the following code.
Assembly assembly = Assembly.LoadFrom("PlgWebSvrAuto.2.dll");
objIConfig = (PlgWebServer.Proxy.IConfig)Activator.GetObject(typeof(PlgWebServer.Proxy.IConfig), "tcp://localhost:8085/PlgCamera");
objIConfig.UpdateDBData();
this goes and hits our server when the solution is executed, but does not work when the dll is installed and executed.
Any ideas please..
Thanks,
Renuga P
|
|
|
|
|
Hi All,
I'm trying to develop a application in vb.net,
to send any file from my PC to any bluetooth enabled mobile,
in coverage area of bluetooth dongle(connect with my usb port).
(More then 1 mobile via loop in 1 go)
Is there any class or library in .net is available.
If you can give me some sample code or link of any article...that will be very helpful for me.
Thnx.........
Vijay Jain
|
|
|
|
|
Hi,
As a part of one of my project implementation I was keen on using a centralized object creator along with the abstract fatory pattern.
As a part of it I have written the following class to solve the purpose of creating an object given an interface:
public class SimpleServiceLocater : ProviderBase, IServiceLocater
{
Dictionary<string, ConstructorInfo> typesDictionary = new Dictionary<string, ConstructorInfo>();
private object[] defaultParamsArray = new object[] { };
private Type[] defaultTypesArray = new Type[] { };
public override void Initialize(string name, NameValueCollection config)
{
base.Initialize(name, config);
}
public override string Name
{
get
{
return base.Name;
}
}
#region IServiceLocater Members
public virtual bool Register<IT, CT>() where CT : IT, new()
{
return this.Register<IT, CT>("");
}
public virtual bool Register<IT, CT>(string Name) where CT : IT, new()
{
ConstructorInfo t = null;
if (!typesDictionary.TryGetValue(typeof(IT).FullName + Name, out t))
{
t = null;
}
if(t == null)
{
this.Unregister<IT>(Name);
}
typesDictionary.Add(typeof(IT).FullName + Name, typeof(CT).GetConstructor(defaultTypesArray));
return true;
}
public virtual IT Resolve<IT>() where IT : class
{
return this.Resolve<IT>("");
}
public virtual IT Resolve<IT>(string Name) where IT : class
{
ConstructorInfo t = null;
if (!typesDictionary.TryGetValue(typeof(IT).FullName + Name, out t))
{
t = null;
}
if (t == null)
{
return default(IT);
}
else
{
return t.Invoke(defaultParamsArray) as IT;
}
}
public virtual bool Unregister<IT>()
{
return this.Unregister<IT>("");
}
public virtual bool Unregister<IT>(string Name)
{
return typesDictionary.Remove(typeof(IT).FullName + Name);
}
#endregion
#region IDisposable Members
public void Dispose()
{
this.typesDictionary.Clear();
}
#endregion
}
<pre>
However I am not sure about any performance implications of using the Activator.CreatInstance vs construcotr.Invoke.
Can any one please guide me or comment on the above class?
<div class="ForumSig">Regards,
Chandu</div>
|
|
|
|
|
This is so basic.
Manish.
|
|
|
|
|
Agreed.
I am interested in knowing the downside of using Activator.Createinstance vs Constructor.Invoke and also about do's n dont's while using them.
Regards,
Chandra V
|
|
|
|
|
When I had that same question, this blog post by the amazing Haibo Luo answered it quite well.
Activator.CreateInstance and beyond[^]
I hope you enjoy it.
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
Thanks will go over it and let you know my thoughts.
Regards,
Cybernate
|
|
|
|
|
Is there any way to invoke remote programs using RDP Client control ..
vineesh
|
|
|
|
|
No. And for good reason. Launching an .EXE on a remote machine is a SEVERE security violation. Think about what some idiot virus writer could do with that ability.
|
|
|
|
|
hi,
after i clicked on 'publish' - a SetUp file was created with a group of files added to it.
i want to distribute it in the internet and in order to do that i need only one file.
do i need to use external program to do that or is there a way to do it from inside the .NET ?
are there any recomendations for external programs to use ?
thanks in advance,
avi
|
|
|
|
|
If you're referring to ClickOnce deployment using Visual Studio, then you will need *more* than one file; you will need at least three: the *.application file, the *.manifest file, and your application file.
You can read all about it at ClickOnce Deployment[^]. If you have any problems following their advice, you can post a question here and I'll respond to it.
I've done that ClickOnce thing more than once.... As long as you stick with the wizard, then you should have little problem. But, you need to read about ClickOnce to understand how it works.
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
yes , i've allready done that , but in order for someone to download a setup program from the internet he needs one EXE file only to run.
ofcorse i can compress them and ask him to decompress before running setup but this is not professional.
i tried the winzip self exctractor but it seems to be unable to handle subdirectories and thus the setup fails.
|
|
|
|
|
Curtis Schlak. wrote But, you need to read about ClickOnce to understand how it works.
shabya wrote: yes , i've allready done that , but in order for someone to download a setup program from the internet he needs one EXE file only to run.
Are you *sure* that you read it? ClickOnce isn't just a single executable that get's downloaded and runs an installation. It makes a lot of files, but the user doesn't need to download those himself.
Just build an installation using ClickOnce, upload it somewhere, and try the generated installation-procedure. Set back, imagine you're a user, click on the link that ClickOnce gives you, and relax
The reason that it's called "ClickOnce" is that the user only needs to click once to download all required components, install and update them. Do you think that it's more professional to let the user download a single file that needs be extracted and stuff?
I are troll
|
|
|
|
|
Again, I stand agape before your excellent answer!
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
I should really learn some social skills. My answer might be correct (which is something to be happy for on it's own account), but it only showed that I know what you are talking about and doesn't motivate to try again.
Your answer does both help and motivate
I are troll
|
|
|
|
|
I've recently returned to the CP forums and I always look forward to reading a reply that ends in "I are troll." Keep up the good work!
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
I are troll
|
|
|
|
|
You have confused me with your questions. Let's think about the two scenarios that you've presented so far:- (Your First Post) Using the ClickOnce feature in Visual Studio
- ClickOnce is part of the Windows Installer system and you only need to publish the ClickOnce files to a public Web server or share. Windows installer does the rest. Windows Installer will download and install all of the necessary files. The user only needs to click on a link.
- (This Most Recent Post) Traditional Installation
- The user downloads a setup package that you built using an Installer project or WiX project or InstallShield project or XXX project. That installation executable then unpacks and installs the software on the machine.
These two choices are essentially mutually exclusive, though some scenarios will have you use a local installer to bootstrap a ClickOnce installation. You really need to understand the difference between these distribution options before you can ask questions about them.
My question to you is which one do you want to do: use ClickOnce and let Windows Installer handle everything for your users by using the Publish feature in Visual Studio, or build a traditional installation package that a user can download?
In either case, here are resources for your education:
Again, I point you to ClickOnce Deployment[^].
And, here's an article right here on CodeProject for Visual Studio Windows Application Setup Project[^] by the somewhat prolific kubben[^].
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
Hi ,
i am using AxWebBrowser to launch web page. I dont have control over the web page.I am requesting the server with the url and embeding the page in AxWebBrowser.
my assignment is I have to print the web page from my application. please note i dont have control over the web page.
i googled and find out the following ways of printing the web page:
Case 1:
object o = "";
//// constants useful when printing
SHDocVw.OLECMDID Print = SHDocVw.OLECMDID.OLECMDID_PRINT ;
//// use this value to print with prompting
SHDocVw.OLECMDEXECOPT PromptUser =
SHDocVw.OLECMDEXECOPT.OLECMDEXECOPT_PROMPTUSER;
axWebBrowser1.ExecWB(Print, DontPromptUser, ref o, ref o);
In case 1,I could call the print dialog and print the web page content. But I cudnt add extra text to the web page. i couldnt find any solution to add extra text to the web page through ExecWB method.
Case 2:
IHTMLDocument2 HTMLDocument1 = (IHTMLDocument2)axWebBrowser.Document;
object pagedoc = HTMLDocument1.body.document;
string acttext = ((mshtml.HTMLDocumentClass)pagedoc).activeElement.innerHTML;
string headertext = "Sample text to the web page";
string mytext = headertext + acttext;
((mshtml.HTMLDocumentClass)pagedoc).activeElement.innerHTML = mytext;
((mshtml.HTMLDocumentClass)pagedoc).execCommand("Print", true, 0);
In case 2, I am able to prompt the print dialog using ExecCommand method and the print the web page content.
To add extra text the web page content , i took the innerHTML and added sample text and tried printing. My problem with this case is , when i tried to use html tags like "center,h4" , print dialog itslef is not promted. in general print is not working.
Can someone plz help me to resolve this problem. Do i need to give any more information. if so plz tell me.thank you
|
|
|
|
|
Hello,
I would appreciate it if you help me in making a code for the UDP Ping by using the .NET.
|
|
|
|