Hi Guys
Factory method is explained in the following website. I couldn’t understand it. I wish to know the meaning of the factory method. Anyone knows please explain.
http://www.c-sharpcorner.com/UploadFile/rmcochran/instantiationFactory06232007153242PM/instantiationFactory.aspx
Thank you
In the article (website address is given above) there is a following part:
In this scenario, when we want to "new-up" our class, we call it through the static method as follows:
Number objTwo = Two.New();
The following code would not compile because the New() factory method now returns a "Number" object and not a "Two" object:
Two objTwo = Two.New();
There is an error. Two objTwo = Two.New(); must come instead of Number objTwo = Two.New();
And Number objTwo = Two.New(); must come instead of Two objTwo = Two.New();
I wish to know whether I am correct or not. Please confirm it.
Thank you, Alan
Well, a factory is a building in which something is manufactured en masse rather than individually.
A factory method manufactures objects. Instead of using the constructor to create the object yourself you ask the factory method to do it for you.
I don't think the name signifies anything more profound than that.
Is there any specific reason for naming it as “Factory Method”?
Initially it gave me trouble I don’t know why. Now it is okay. Thank you very much for the explanation, Alan.
Let me say Microsoft Word file “A” in the folder1 and Microsoft Word file “B” in the folder2. Whether it is possible to link A and B. Note that here the files are in different folders. If it is different method please tell me.
I'm not entirely sure what you're asking though you can certainly create links within Microsoft Word documents, using a similar approach to how we create them on here.
Type in the text for the link and select it.Right-click the text and select Hyperlink.In the text box which opens up, enter the url for the link and click Insert.
I wish to know whether it is possible to link Microsoft Word document in different folders. If it is possible please tell me.
First type in the name of the link (i.e. the text that you want to be underlined), and then select it.
Now in the tool bar click on the Create Link button (ball and chain symbol), type the url for the link into the box that opens up and press OK.
For example, if I've typed in the url correctly, this link will take us to the C# Corner home page.
If you know HTML, you can also add a link by switching from Design to HTML view and typing in <A href= followed by the url in double quotes and then by: >name of link</A>.
When click the following one (this one is above) relevant website is displayed.
Illustrated GOF Design Patterns in C# Part I: Creational
Anyone tell me please how to create this link.
Thank you very much for your explanation and giving me the website address, Jan