![]() |
|
[C] Anybody familiar with design patterns? - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118) +---- Thread: [C] Anybody familiar with design patterns? (/showthread.php?tid=5243643) |
Anybody familiar with design patterns? - Supportâ„¢ - Apr 20, 2016 Hey guys! There is a part of my assignment that I need to implement a design pattern in the project I am working on. It is a simple data management software which has only one class(Employee class) and a form for performing Create, Read, Update and Delete(CRUD) operations. Here is my Employee class: Code using namespace System;Then in the form operations, I use this method to create employee records: Code public: System::Void createEmployee( String^ employeeID, String^ firstName, String^ lastName, String^ emailAddress){What design pattern does this fall under? I'm suspecting that it is either Builder pattern or Singleton pattern. If not, can you enlighten me about what has to be changed in the above class and method to make it one of these two patterns (or) which is the easiest design pattern to follow if I have rebuild this class from ground up? It is not a complex assignment, it ends right here. * - 0xDEAD10CC - Apr 20, 2016 Why does this class have multiple public labels? It makes zero sense, and why would it be a singleton if this is the case: Code public:Public default constructor, accessible copy constructors... None of which a singleton by definition would allow. * - Supportâ„¢ - Apr 20, 2016 (Apr 20, 2016 02:25 AM)0xDEAD10CC Wrote: Why does this class have multiple public labels? It makes zero sense, and why would it be a singleton if this is the case: Found that out after reading more about design patterns. Currently, it is safe to say that I don't know much about these. Closing the thread to start reading :D I have found a nice place which explains about design patterns and hope it helps someone else too. http://www.tutorialspoint.com/design_pattern/index.htm (Although it's in Java, I can understand the concepts) |