Why an "Awaiting moderation" text appears instead of my comments?
question about Creational patterns
Hello Guest
  
  • Login
• Register…
• Start blog
  • Who, Where, When
• What can I do?
• What to Read?
  • Polls
• Avatars
• Interests
  • Cities and Countries
• Random blog
• Users search
  • Search
• Games
• Tests
• QAIX
  • Сообщества
• Talxy Chat
• Horoscope
• Online
 
Зарегистрируйся!

QAIX > .Net Development > question about Creational patterns 12 November 2003 11:53:00

  Recent blog posts: 
  They have birthday today: 
  Forums:   
  Discuss: 
  Recent forum topics: 
  Recent forum comments:
  Moderators:

question about Creational patterns

Daniel Young - IS 12 November 2003 11:53:00
 Can someone explain the point of creational patterns to me as they don't
make much sense to me.



My understanding is that they allow you to easily add a new type to create
if you use a factory to create it without having to change code. However
most new objects I have created require a different constructor which
requires modifying code anyhow as well as adding the new class.



If you have to modify the class anyway, why not just create the object when
I want to use it as apposed to creating it through the factory..



Regards

Daniel




___________________­____________________­_

Caution: The content of this email is confidential and may be legally
privileged. If it is not intended for you, please email the sender
immediately and destroy the original message. You may not copy, disclose or
use the contents of this message in any way.

Important: Employees of EziBuy Ltd are expressly required not to make any
offensive or defamatory statements and/or not to communicate offensive
material. Any such communication is contrary to company policy and outside
the scope of the employment of the individual concerned. EziBuy Ltd will
therefore not accept any liability in respect of such a communication, and
the employee responsible will be personally liable for any damages or other
liability arising.
___________________­____________________­_

Add comment
Larry O'Brien 12 November 2003 08:47:12 permanent link ]
 
Can someone explain the point of creational patterns to me as> they don't make much sense to me.

Well, I think the easy answer for Factory is that it allows your code to
specify just an interface, while the particular implementation is (at least
conceivably) driven by a configuration file. Additionally, Abstract Factory
allows you to coordinate the creation of a set of mutually related classes,
which is certainly beneficial. Also, certain creational patterns (such as
Singleton) allow you to control the total number of objects of a particular
type that are instantiated, which is another oft-desired feature.

Cheers,
Larry
http://www.Thinking­In.NET/

Add comment
Lars Wilhelmsen 12 November 2003 11:53:00 permanent link ]
 Hi Daniel,

A criteria for the creational patterns is often that they rely
on a common constructor, typically the default (with out parameters).

It is generally good coding practice to have a default constructor,
and a set of methods/properties that does the same functionality as
the parameters to your specialized constructors (The one you're
referring to).

Here's a link to a website with many of the GOF patterns implemented in
C#:
http://www.dofactor­y.com/Patterns/Patte­rns.aspx


Regards,

Lars Wilhelmsen
Software Engineer
Teleplan AS
Norway

-----Original Message-----
From: Discussion relating to the specifics of the C# and Managed C++
languages [mailto:D­OTNET-CX@DISCUSS.DEVELOP.COM] On Behalf Of Daniel
Young - IS
Sent: 12. november 2003 05:58
To: DOTNET-CX@DISCUSS.D­EVELOP.COM

Can someone explain the point of creational patterns to me as they don't
make much sense to me.



My understanding is that they allow you to easily add a new type to
create if you use a factory to create it without having to change code.
However most new objects I have created require a different constructor
which requires modifying code anyhow as well as adding the new class.



If you have to modify the class anyway, why not just create the object
when I want to use it as apposed to creating it through the factory..



Regards

Daniel




___________________­____________________­_

Caution: The content of this email is confidential and may be legally
privileged. If it is not intended for you, please email the sender
immediately and destroy the original message. You may not copy,
disclose or use the contents of this message in any way.

Important: Employees of EziBuy Ltd are expressly required not to make
any offensive or defamatory statements and/or not to communicate
offensive material. Any such communication is contrary to company policy
and outside the scope of the employment of the individual concerned.
EziBuy Ltd will therefore not accept any liability in respect of such a
communication, and the employee responsible will be personally liable
for any damages or other liability arising.
___________________­____________________­_

Add comment
 

Add new comment

As:
Login:  Password:  
 
 
  
 
Пожалуйста, относитесь к собеседникам уважительно, не используйте нецензурные слова, не злоупотребляйте заглавными буквами, не публикуйте рекламу и объявления о купле/продаже, а также материалы нарушающие сетевой этикет или УК РФ.


QAIX > .Net Development > question about Creational patterns 12 November 2003 11:53:00

see also:
ASPX Page as Resource?
VS creating duplicate projects…
Casting to a type stored in a…
пройди тесты:
see also:
Pjatnicha 13
W.I.T.C.H W is for W.I.T.C.H (3/3)h...
Novenkaja!

  Copyright © 2001—2008 QAIX
Idea: Miсhael Monashev
Помощь и задать вопросы можно в сообществе support.qaix.com.
Сообщения об ошибках оставляем в сообществе bugs.qaix.com.
Предложения и комментарии пишем в сообществе suggest.qaix.com.
Информация для родителей.
Write us at:
If you would like to report an abuse of our service, such as a spam message, please .