Click here to Skip to main content
15,891,372 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I read about Facade pattern and believe that it hides the complexity of a subsystem by offering a simpler and more concise way to access it.

If I create a utility class DateUtility to manage date related activities like it can have methods like GetDateFormatDDMMYYY, CompareDate etc..all date related utility methods which are static.

Will this class DateUtilityqualify to be an example of Facade Pattern as I am creating a sub system for managing dates.

I am using .NET.

Responses will be highly appreciated.

Thanks.

Regards,
Sakshi
Posted
Comments
Richard MacCutchan 18-Jul-13 9:11am    
Why would you need to when there are perfectly adequate .NET classes to handle dates and times?
Sakshi Smriti 18-Jul-13 10:55am    
Thanks Richard for the reply, I am not using this utility this is just an example.

This is an example of Utility class, I am using the .NET classes and if creating some related methods does it qualify to be a facade pattern.

My main doubt is still that do utility classes in our projects qualify for a Facade pattern
Richard MacCutchan 18-Jul-13 11:15am    
You could try reading some of these articles for explanation. However, rather than creating or modifying some class and hoping it matches the pattern, it is better first to decide whether this pattern is useful in the development of your application.
Sergey Alexandrovich Kryukov 18-Jul-13 15:13pm    
Very good points and recommendations. In both of your comments.
Not that this is the anti-design-pattern view, this is a very important appeal to think critically.
I added some thoughts in my answer, please see.
—SA
Sergey Alexandrovich Kryukov 18-Jul-13 15:01pm    
You are right, this is the utility class, and hence this is not the example of facade pattern.
—SA

1 solution

Please see the comments to the question, especially good ideas conducted by Richard MacCutchan. No, this is not the example of the facade pattern. Utility class is a utility class. I'm afraid to be too generic, but I would think that none of the utility classes can represent a facade pattern.

Well, about design patterns… it's even awkward topic for discussion but… Well, the patterns are good to understand and know, at least most known ones. But… do you understand that there are names of things and some universal notions behind them? Come to think about, that's the difference how you talk about some techniques, if you perfectly understand them and know their values and drawbacks, and, most importantly, their limitations in relations to the goals you have? You need to think about inner essence of things first and only then about classification of them into well-defined or well-known category. Such classification can be too rough for some elements of reality or simply missing, but it does not put the essence of things under question.

And I think if you read about "Criticism" section in the pattern article, it can be useful: http://en.wikipedia.org/wiki/Software_design_pattern#Criticism[^].

Also, please see the discussion over this question and my answer: Software Design Dilemma[^].

Part of the discussion is devoted to design patterns, in the comment. There are some interesting and useful thoughts, I think. Please see.

Also, I want to reiterate that it's more important to understand, identify and detect anti-patterns. Please see: http://en.wikipedia.org/wiki/Anti-pattern...

—SA
 
Share this answer
 
v4

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900