|
The minimum is zero; you can be accepted into developing positions without knowing a design-pattern.
After that you'll be introduced to code. At that point you'll at least need to learn the patterns that are used throughout the code-base. There's never a list, and in a team, no-one knows exactly.
As you progress, you should stay on the lookout to discover patterns you didn't already know. I'm trying to add one a month, but I forgot which month
A pattern is a known solution to a known and limited problem that can be re-used. It is rather beneficial to have them in code, as they are more easily read (once you recognize them) then code with an unpredictable layout. Knowing a pattern also means you have an accepted solution to a common coding problem, which means "the more, the better".
Once you are in that position, things start to click; you'll recognize them in the .NET framework, in code-examples and your own old code.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Eddy really you have a different idea.thanks
|
|
|
|
|
Gyanaranjan Dash wrote: Eddy really you have a different idea You're welcome, but I do not see much difference.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Hi,
Be aware that Gang of Four might not be the best book to start with. Browse the ratings on books that use language/modeling that is relevant to you.
Be aware that one man's pattern is another man's anti-pattern. Sell Singletons to your enemies and give Observers to your friends.
When you do dig into the Gang of Four and/or other books, please note that they are all about splitting communication and data up in interfaces, abstract and concrete objects in a specific way. This is what object oriented design is all about. The patterns are different standard design solutions.
EDIT: Forgot one. Please also notice that people "talks" patterns in different abstraction levels. Sometimes people refer to Intent of a pattern. Sometimes people refer to a standard design code solution. People focused on Intent will claim that an anti-pattern is nonsense. People focused on code solutions will claim that Singleton is an anti-pattern. Confused? Good, start reading
|
|
|
|
|
I am in the design phase of an app that will have a component like DropBox.
There's doesn't seem to be much info on their overall architecture. I'm guessing it's not much more than a folder watcher calling a WCF or MVC service.
Any reason I should not follow that model?
|
|
|
|
|
I'm pretty sure it uses a shell extension to implement the Drop Box folder. Shell Extensions are no laughing matter because they can be complicated.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Hi i am planning to design a cloud storage service using design patterns and uml
I identified following use cases
user signup
user sign in
manage folders like update delete edit share etc
upgrade account
sync data
manage profile
etc
i identified following classes
User class
account class
profile class
drive class etc
so now to extend further i want to know what all design patterns like factory pattern , observer pattern , decorator pattern can be used in designing this google drive.
can anybody help me in sending a class diagram for cloud drive
Thanks
karth
modified 27-Mar-15 14:50pm.
|
|
|
|
|
Member 11524998 wrote: i want to know what all design patterns like factory pattern , observer pattern , decorator pattern can be used in designing this You don't (read: shouldn't!) use design patterns for the sake of using design patterns.
Member 11524998 wrote: can anybody help me in sending a class diagram for google drive I don't think anybody but Google will have that.
No offense intended but your question strongly indicates that this kind of project is some orders of magnitude beyond your current skill set. I would recommend you to start a bit smaller.
|
|
|
|
|
He is looking for help with his college project.
He won't be doing something like this for any other reason.
That is also why he is asking what design patterns he should be using. The instructor told him to use as many as possible!
|
|
|
|
|
Vivic wrote: That is also why he is asking what design patterns he should be using. The instructor told him to use as many as possible! I would recommend making sure there wasn't a misunderstanding. If the instructor said "use design patterns wherever reasonable" it would make sense.
Vivic wrote: He is looking for help with his college project. Wouldn't you consider asking for a ready made class diagram cheating? To me it looks like a pretty big and important part of his project.
I would find it more reasonable if he already had designed something and would ask for feedback on that.
|
|
|
|
|
Sascha Lefévre wrote: Wouldn't you consider asking for a ready made class diagram cheating?
Yes.
Sascha Lefévre wrote: if he already had designed something and would ask for feedback on that.
The scope of a real application wouldn't be presentable at the level posted by the OP here.
Conversely the content of the OP is something would expect to see as something like a major project in a college level course.
|
|
|
|
|
Check out the guy's location: India.
Definitely a college project.
Send codez plz! Urgent!
|
|
|
|
|
Hi, im new to "via internet communication". I have an experience in VB.Net application development and some embedded device like arduino and raspberry pi. I just want to learn how can i transfer data from my .net application to my embedded device. What i have done before,
1.i registered for free web hosting that support PHP and SQL database.
2. wrote PHP code that will receive data from .net application and store the data to sql database.
3.develop my .net application that will parse the data to the PHP in the webserver.
4. write code for my embedded device, where it will retrieve the data that has been stored in the SQL database.
by doing this, it looks like my application is "talking" to my embedded device. So i would like know, is there any smarter way i can achieve my objective?
|
|
|
|
|
It largely depends on what interfaces you have available at your embedded device. If it can connect to your PC by serial or USB, then you have serial communication. If by Bluetooth/WiFi/network then you could have socket connection.
|
|
|
|
|
Can you define "smarter"? Does that mean sending less bits, keeping the connection open for a shorter time, what?
If your communication is message-based, then yes, http would be a nice protocol. It is well defined, documented and tested. If you need to stream, I'd go for a simple socket.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Introduction
For a project i'm working on, i have to find a good way to store what actor information's are known to another actor. And it's starting to get a bit over my head.
Model-Classes
EntityModel - Base class for all entities
using System;
using System.Xml.Serialization;
namespace Relink.Data.Model {
[Serializable]
public class EntityModel {
[XmlIgnore]
public Int32 EntityID {
get;
set;
}
#region XML Wrapper
[XmlElement("EntityID")]
public String XmlEntityID {
get {
return this.EntityID.ToString();
}
set {
try {
this.EntityID = (Int32)Int32.Parse(value);
} catch {
throw new NotImplementedException();
}
}
}
#endregion
}
}
ActorModel - Base class for all actor's
using Relink.Data.Enum;
using System;
using System.Xml.Serialization;
namespace Relink.Data.Model {
[Serializable]
public class ActorModel : EntityModel {
public String Firstname {
get;
set;
}
public String Lastname {
get;
set;
}
public String Nickname {
get;
set;
}
[XmlIgnore]
public Gender Gender {
get;
set;
}
[XmlIgnore]
public DateTime Birthday {
get;
set;
}
public String Emailadress {
get;
set;
}
public String City {
get;
set;
}
public String Country {
get;
set;
}
#region XML Wrapper
[XmlElement("Gender")]
public String XmlGender {
get {
return this.Gender.ToString();
}
set {
try {
this.Gender = (Gender)System.Enum.Parse(typeof(Gender), value);
} catch {
throw new NotImplementedException();
}
}
}
[XmlElement("Birthday")]
public String XmlBirthday {
get {
return this.Birthday.ToString();
}
set {
try {
this.Birthday = DateTime.Parse(value);
} catch {
throw new NotImplementedException();
}
}
}
#endregion
}
}
Description
Basically i need to store what information's each actor has about another actor, similar to a boiled down facebook. The problem is, this has to scale for a couple hundred actors at once, i.e. this could get out of hand pretty fast.
Question
Is there a decent way to accomplish something like that, or do i have to boil the whole idea down a bit and make it just a "who know's who" sort of thing?
|
|
|
|
|
Are the shown ActorModel's properties the information in question? If yes, exclusively? If not, what else?
- Sebastian
|
|
|
|
|
The properties within the EntityModel and ActorModel are the information's in question. Derived from from the ActorModel are several Classes with additional information, but for "simplicity" I've omitted those children classes.
I've thought of converting those properties to classes and include a List inside that store the EntityID of actors who know this specific information, but i'm not sure how this will work out on a larger scale.
|
|
|
|
|
Since the amount of access-restricted elements (properties in this case) is restricted and known at design-time it shouldn't be overly complex. In the database you could represent it as a table with the EntityIDs of the property-owning Actor and property-accessing Actor as a compound primary key and boolean "is-Property-Access-allowed" columns. Outside the database you could map that to a dictionary with a Tuple<PropertyOwningActorEntityID, PropertyAccessingActorEntityID> as key (I would subclass the Tuple-class though and map the "Item1" and "Item2" properties to more expressively named properties). Could that be a solution for you?
|
|
|
|
|
Well, it really looks like that the database approach is the right thing to do and since i'm very familiar with databases, it shouldn't be a problem to adapt the code to that.
Thank you.
|
|
|
|
|
I don't have any experience with EF; but it looks like it is going to be serialized to XML?
A couple of hundred records would be very easy with a database. You'd simlpy have an Actors table, and a table that links an actor to multiple others.
Daniel Lieberwirth (BrainInBlack) wrote: public String XmlBirthday If it is a data, then pass it as a date, and not as a formatted string.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Hmm, a database never has come into my mind, but would be good solution. Have to think about it and let it cook in my head for a while.
Eddy Vluggen wrote: Daniel Lieberwirth (BrainInBlack) wrote: public String XmlBirthday If it is a data, then pass it as a date, and not as a formatted string.
That's in there to avoid problems with XML deserialization.
|
|
|
|
|
If I was going to implement a "who knows who", I would use a "relationship" entity.
Conceptually, this would like: [Actor]<--->>[Relationship]<<--->[Actor]
The "relationship" entity could include "intersection" data describing the relationship: e.g. father-son; brother-sister; etc.
Physically, this is implemented as a recursive database structure:
|--->[Actor]--->>[Relationship]---|
| |
|---------------------------------|
For example:
Actors
------
ID: 1; Name: Joe
ID: 2; Name: Jane
ID: 3; Name: Billy
ID: 4; Name: Sue
Relationships (ID1; ID2; RelationDesc1; RelationDesc2 ...):
-------------
1; 2; Husband; Wife
1; 3; Father; Son
3; 4; Brother; Sister
etc.
ID1 and ID2 are foreign keys (which could be concatenated to create a unique "relationship" key; or one could use a separate ID but then one would need to insure there are no duplicate relationships).
The rest is "intersection data" (i.e. it only has meaning in the context of a relationship).
|
|
|
|
|
That's actually i pretty good idea, since the initial idea will probably be dropped because it will get to complicated in the context of the game.
Your solution is very simple, but allows for RelationshipType access. I.e. husband and wife probably know everything about each other, where a colleague probably just knows the name and maybe the birthday.
|
|
|
|
|
Something I forgot to mention...
The implementation of a relationship that I suggested above (i.e. [1; 2; Husband; Wife]) using a single record, is somewhat asymmetric.
Although a little bit more work to implement, but more symmetrical (and therefore easier to query), is to implement a "bi-directional" relationship using 2 records; e.g.
Actors
------
ID: 1; Name: Joe
ID: 2; Name: Jane
Relationships
-------------
From ID: 1; To ID: 2; Intersection Data: Husband; Wife
From ID: 2: To ID: 1; Intersection Data: Wife; Husband
Both records should have an identifier that would identify them as being part of the same relationship; that is, Husband-Wife and Wife-Husband. This make it easier to maintain in the future (update; delete).
Conceptually, you now have:
[Actor]<---\ /--->[Actor]
| \ / |
| X |
| / \ |
[Wife]-----/ \---[Husband]
And physically:
[Actor]--->>[Relationships]
(It's been a while for me, but this is in fact how IBM's IMS-DB implemented bi-directional relationships).
On the other hand, you could "explode" the single relationship record into 2 records at "run-time" using SQL; if that was easier (probably).
modified 5-Mar-15 5:37am.
|
|
|
|