|
Thanks for sharing link..
|
|
|
|
|
Your Welcome!!!
Praveen Raghuvanshi
Software Developer
|
|
|
|
|
There is some Interface e.g. database and many implementation Imp1, Imp2, Imp3, ... e.g. sql database, xml database, in memory database.
Then there is a Factory to create those implementations returned as Interface objects.
How to assign them to different assemblies?
Interface and implementations should be in different assemblies to allow shipping to some clients product with sql database implementation, otheres with xml database etc...
But what assembly to put Factory ?
If it is put with Interface or any other separate assembly it will need to ship all the implementations assemblies with it.
I do not want to vialote DIP to allocate implementations directly in the code.
Чесноков
|
|
|
|
|
Although it's not stated directly, I assume that your question is about .NET (the word 'assembly' points in this direction).
We solved this problem by creating an extra level of methods around the instantiation points of implementation, like this:
class DbFactory {
public static InterfaceDb Make(string kind) {
switch (kind) {
case "xml": return MakeXmlDb();
case "sql": return MakeSqlDb();
}
throw new ArgumentException("kind");
}
private static InterfaceDb MakeXmlDb() {
return new XmlDb();
}
private static InterfaceDb MakeSqlDb() {
return new SqlDb();
}
} This code does not throw an exception when the assembly with SqlDb is missing unless you call Make("sql"); calling Make("xml") runs fine as long as the assembly with the implementation is present.
Note: this functionally equivalent code does not work the same way:
class DbFactory {
public static InterfaceDb Make(string kind) {
switch (kind) {
case "xml": return new XmlDb();
case "sql": return new SqlDb();
}
throw new ArgumentException("kind");
}
} This code requires both assemblies to be present.
|
|
|
|
|
What is a good functionality to build to restrict people (the general public) from voting multiple times?
Also, any thoughts on the design and architecture of a site that will hold about 100 videos with people coming to view and vote on them....where we are sure about the expected incoming traffic ?
|
|
|
|
|
???
Ummm...
Voting... require them to log in using a username and password and then store what they already voted for. DO NOT restrict them based upon IP address because that will just lead down a slippery slope of recycled addresses provided by ISPs.
Now the other question..
Why are you even asking… if you look around there are tons of pre done sites that you can leverage for things like this. Why redesign your own?
How can you be SURE of the expected incoming traffic?
|
|
|
|
|
True. I was trying to find out what other options are available.
Also, there are sites where you can give your original email addr and it returns back 10 or 20 email addresses that you can now use. If the voting system now sends an email to those email ids with a link to click to confirm , all emails are routed to their original email address and thus they have access to all the emails. Is anyone aware of such sites? Any names of these sites?
|
|
|
|
|
I am getting a bit confused here about what it is that you are REALLY trying to get to...
I am sure that your system could probably just do a numeric increment (IE: username1@..., username2@..., etc...) but that is not going to guarantee that someone has those addresses registered, or even wants you know know about them or use them.
I would rather see that you just stick yo your initial requirements really. Your original requirements were to allow people to only vote once. YOU cannot be responsible for people that have multiple email addresses setup (like I do - in reality almost 12 in total for various reasons) nor do I think it is your responsibility to care really. If someone signs up like that whats the big deal? I would think that making assumptions bassed upon some personally designed algorithm could lead you down a slippery path of ticked off customers more than anything in the long run.
Do some basic checking (IE: If they are dumb enough to sigh up using different user names but then use the exact same user name and password, or actual name, or addresses, etc...) and remove them, but the others, whats the big deal?
|
|
|
|
|
I am currently using "Smart Draw" to draw UML designs and such but it has lots of small annoyances.
Does any one use anything "smarter" ?
Just looking for a nice software modelling package that supports UML and maybe other stuff (such as packages).
|
|
|
|
|
You might want to look into StarUML[^]. It's a free, fully-featured UML package.
|
|
|
|
|
|
Here is an extensive list.
Personally I know Rational Rhapsody, Rational Rose (which is quite different) and Enterprise Archtect quite well. The first one I like the best as it not only lets you generate State diagrams, but also can run them, so you can see what state a particular state machine is in rigth in your diagrams while the code is being executed. A very visually oriented way of debugging. Unfortunately it's also the most expensive of these tools.
It's been a long time I've used Rational Rose, and it seemed inferior to Rhapsody. At that time both products did not belong to IBM yet. I am not quite sure what kind of effect IBM had on the further development of these two direct competitors after obtaining them...
Enterprise Architect is something you can easily afford even for private purposes, and it covers most of the functionality of the more expensive products. It is what I use now, mostly for designing class hierarchies and generating code, but also occasionally for reengeneering some fossile code bases.
|
|
|
|
|
I am developing an application that will allow the customer to purchase different snap-in components. These components represent versions of different technologies. As an example, if they own MS Word 2000, they can purchase the plugin MSWD2000.dll. If they own MS Word 2003, they can purchase the plugin MSWD2003.dll, and for MS Word 2007, they can purchase the plugin MSWD2007.dll, and so on.
What I'm considering doing is creating an MSWord_Base class, then a MSWord_2000 class based off of it, then a MSWord_2003 class based off of the MSWord_2000 class, and so on. Each project would be in the same MSWord solution. This design allows me to generate seperate DLL's for each version of Word.
1) Anyone see any issues with this? I welcome better ideas
2) How would the app know what snap-ins are available?
3) How do I keep someone from using the DLL in another .Net app? I would want to prevent method calls from working unless the user is registered.
Thanks
Everything makes sense in someone's mind
|
|
|
|
|
Kevin Marois wrote: 1) Anyone see any issues with this? I welcome better ideas
None worth mentioning.
Kevin Marois wrote: 2) How would the app know what snap-ins are available?
Create a plugins directory in the same way that an application such as photoshop has. Let your application look for Dlls in this directory that match your plugin rules, and load them as appropriate. I would suggest that you would want to look into the Managed Extensibility Framework (MEF) from Microsoft to do this - it has the ability to automatically load items from a directory using something called a DirectoryCatalog.
Kevin Marois wrote: 3) How do I keep someone from using the DLL in another .Net app?
I'd use a public/private key between your application and these DLLs (if I were you, I'd look to write it in an unmanaged language such as C++, and p/invoke it from both sides).
|
|
|
|
|
Seems a fair way to go about it, but as a pondering point, might i propose an alternative:
Strategy pattern
have a single concrete MSWord class that calls out to strategies for each 'area' of logic (e.g. Import strategy, export strategy, gui embedding strategy, etc)
Then provide strategy classes for each variation of each logic area
Wrap the whole thing up in a factory pattern which decides which strategies to stick into the MSWord class when it is created.
The advantage of this is that its more flexible should microsoft ever decide to revert functionality (so that, say version 3 has the same functionality as version 1 in some logical area but different from version 2)
hope that makes sense
|
|
|
|
|
Are there application design and development articles with sources, preferable in C#, which illustrate how to design and develop typical applications (GUIs, databases, etc...) according to design patterns as in:
Robert C Martin "Agile Principles, Patterns and Practices in C#"
Erich Gamma "Design Patterns: Elements of Reusable Object-Oriented Software"
Чесноков
|
|
|
|
|
CSLA.NET jumps to mind. Not really an article, more a framework. You might also want to take a look at the Enterprise Library, and the Patterns & Practices on MSDN.
Don't cross-post, please.
I are Troll
|
|
|
|
|
|
Need help understanding....when SCRUM teams are set up? Once a project proposal has been accepted by the client, is this when the SCRUM team is put together and who is responsible for putting the team together?
In the waterfall method, there is project scope (initiated by client) or we propose a concept, here we have the requirements phase and the necessary technical team help set the requirements and tool used....the proposal gets estimated ($$) by appropriate team members and if approved by client....development begins. How does SCRUM fit into all of this?
Do we simply gather vague requirements from client and build SCRUM Team who then will clarify the requirements by defining how and what tools will be used, etc.??
How do projects get estimated in SCRUM before development begins?
|
|
|
|
|
vague requirements
No Vague requirements .. With the JUST ENOUGH requirements , some baselined user stories are taken into account and the team can start the work.While the team is working on the user stories, the Scrum master, Product owner and the Stake holders can come up with new user stories , which will be put into Product Backlog.
In a Scrum methodology, there is no need to gather all the requirements, design everything and start the work.
There is a concept call JUST ENOUGH.
Remember all the estimations should be made involving the team.
The user stories can be anything , its not just coding and testing along... Like how and what tools will be used.
The project estimation is based on Story points which signify the complexity of a user story.
Let us say , 1 point Story = 2 Hrs = 2 hrs * $20 = $40
Thanks to my colleague, Sendhilraj who also contributed to this post.
Praveen Raghuvanshi
Software Developer
|
|
|
|
|
Thanks for your response.
I am still unclear of how the estimation works....in waterfall method each areas of expertise has already estimated ($$) the project after the business is awarded the team begins the work and after the project is completed we can view if our estimate was off.
With SCRUM I understand the SCRUM Team will estimate the hours for the tasks selected for that sprint. But what about estimating the entire project as a whole. Customer would definitely want to see numbers before the project is awarded.
|
|
|
|
|
Initially, estimation for the budget and time will be done by the experienced person(s) and it would be based on story points.
once the project is approved, sprints will be discussed with the team and estimate it.
Hope this helps!!!
Praveen Raghuvanshi
Software Developer
|
|
|
|
|
I have worked in Scrum team and i assure it is no way Waterfall model, rather mix of and more near to iterative model, v-model, spiral model,..
The rough estimation is usually done for a story first by product owner. Say a story is estimated with 8 hours of task.
Then we distribute cards to team which have 7 cards each with 1,2,3,5,8,13,20. Each member tells his estimate for work. One on extreme side usually justify their estimates and we come to conclusion by discussion.
|
|
|
|
|
Is there a design heuristic in object oriented programming that states that an object shouldn't send messages to objects it creates?
Is one of these "better"?
class AnotherClass
{
public:
AnotherClass(SomeClass *obj)
{
this->obj = obj;
this->obj->DoStuff();
}
};
SomeClass *obj1 = new SomeClass;
AnotherClass *obj2 = new AnotherClass(obj1);
vs.
class AnotherClass
{
public:
AnotherClass()
{
obj = new SomeClass;
obj->DoStuff();
}
};
AnotherClass *obj = new AnotherClass();
I have a vague memory of reading somewhere that the first version is a better design, but I can't remember why. I haven't found anything Googling.
|
|
|
|
|
Hi Leslie,
I prefer the first. The second creates its own SomeClass instance, without any parameters or specialization. So creating two AnotherClass() instances would cause exactly the same things to happen twice. The first snippet makes much more sense to me.
From your snippet it isn't really clear why you need two classes in the first place. I also expect real names for the classes would make things more obvious.
|
|
|
|