|
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.
|
|
|
|
|
Luc Pattyn wrote: 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.
It was a quick and dirty example. I'll try to do better.
I've been doing iPhone programming, and using the Model/View/Controller pattern (or at least one variation of it) is encouraged by the architecture. Say we have a model.
class Model
{
public:
};
The controller uses the model, but should it also be responsible for creating it? Assume for the sake of argument that an instance of the model isn't used any where else besides the controller class. I guess it then becomes academic, but I seem to remember reading some where that objects shouldn't use the objects they create. I can't remember why or where I read that.
I was wondering if this:
class Controller
{
public:
Controller(Model *model)
{
this->model = model
}
};
Is better than this:
class Controller
{
public:
Controller()
{
this->model = new Model();
}
};
Maybe the reasoning as to why the first approach is better is that if we use polymorphism, we can switch out which model is used by the Controller; we can't do that in the second example without changing the Controller class.
Also, maybe as a general rule factory code should be seperate from the rest of the code?
|
|
|
|
|
I have no authority on the MVP/MVC subject nor on iPhone, however here are some thoughts:
1.
Leslie Sanford wrote: objects shouldn't use the objects they create
does not make much sense to me. When I create objects I want to use them, or pass them on for others to use them.
2.
Leslie Sanford wrote: factory code should be seperate from the rest of the code
I second that. The purpose is you can (and often have to) change the factory, however you don't want to touch the code in the object's users.
3.
You need some overall code anyhow (say the static Main method in a C# app); so it can create Model, View, and Controller; in the right order; and pass the required ones as parameters to the other constructors. Maybe you even want interfaces, rather than actual classes passed in.
So definitely your #1 approach for me.
Suggestion: have a look at some other iPhone apps, there's bound to be some here in CP articles.
|
|
|
|
|
The decision you have to make is all about dependency. The first alternative implements a loose dependency between the controller and model. In the second alternative, the dependency is hard coded into the controller. Therefore I definitely vote for the first one.
However, I am surprised that you are given this choices at all. Without knowing much about IPhone UI programming, all the other UI frameworks I know have some kind of preferred architecture model. While you can program "around it", by doing so you exclude yourself from using certain techniques or tools which could make your application unusable by third parties or make things like customization, styling, themeing etc... exteremly difficult. For example, Microsoft's presentation frameworks like WPF or Silverlight do not enforce a specific model but if you choose not to follow the guidance, you exclude yourself from things like easy data binding, dynamic UI composition, easy cooperation with designer tools and much more...
So follow Luc's advice and have a look at some exemplary IPhone applications or even better on Apple's guidelines about the architecture model for UI.
Cheers,
Paul
|
|
|
|
|
I'm looking for ideas/guidance on how to design serverside functionality for interacting with a database. My situation is pretty typical. I have PHP "scripts" that receive request variables. Based on the parameters passed to it, the script queries a database, formats the returned data in some way, and returns it, usually in JSON format.
I've tried taking various approaches to managing the code for this. For example, I've written sets of functions for querying the databse, e.g. getCustomerByName, getProductsByPrice, etc., with each of these functions containing the necessary SQL code. The problem is that you can have an explosion of these types of functions. And sometimes the queries can get quite nuanced so that you wind up with long named functions like getCustomerByNameAndCountry. This approach doesn't seem to scale well, and has made me a little disillusioned with encapsulating SQL queries in functions.
I was thinking about making functions that are more generalized. Something like getCustomer($columns, $where, $orderBy). In other words, parts of the SQL query would be defined outside of the function and passed in. As long as everything is escaped properly, this should be safe. This approach would mean put the responsibility of parsing the request parameters, determining exactly what is being asked for, and then transforming the request parameters into partial SQL statements that would be passed to general functions for performing the actual query.
But then maybe the functions aren't needed at all?
Anyway, I'm relatively new to DB/severside programming; I've been doing it for less than a year, and I'm still struggling with how to structure a system. Any thoughts are welcome.
|
|
|
|
|
In my experience, when it comes to "combinatorial explosions", your projections (i.e. $columns) and ordering (i.e. $orderBy) are not as much a problem as the query conditions themselves: you will need to hard-code nearly as many values passed for the $where as the number of 'get<...>by<...>' functions you previously needed to code.
The solution I've been using is generating my 'where' clauses dynamically. This way, instead of pre-made 'where' clauses you'd build collections of uniform items from which your SQL can be generated. For example, a list of name-value pairs could be used to generate a conjunction like name1=value1 AND name2=value2 AND ... nameN=valueN . More advanced solutions include use of expression libraries, such as LINQ's Expression in .NET, to formulate composite queries of arbitrary complexity (with 'OR's, 'AND's, 'NOT's, and function calls).
P.S. Any time you generate SQL dynamically you should be very careful to avoid the SQL Injection Trap; other than that, you should be OK.
|
|
|
|
|
I writing some application that find ( according to some question ) information about some person ( lets say that the information are weight, hight and age of the person ).
In the other hand i have product list ( can be very big one ) and according to the product information i need to find the best matching between the person information and the product ( the product information that i have are water part, nitrogen part and ext. )
I can't use flow chart algorithm or Breadth-first search because the number of the product is dynamically ( read the product list from DB ... )
|
|
|
|
|
Since much detail has been left out (which is expected, given that it's an architecture forum) I'd make an assumption that finding the "best matching" can be expressed mathematically as finding an extremum of a function of some sort, and that the product list is stored in a SQL database.
Suppose that the quality of the match can be evaluated as a function MatchQuality. When you get parameters of a person for whom you're finding a matching product, you can build a SQL query that corresponds to your MatchQuality function and the parameters of the given person. Consider this silly example: suppose your MatchQuality(age, weight, water, nitro) = age^2/nitro + water/weight , and the match is best when MatchQuality is highest. A query for the best product comes in: weight=170lb, age=65yr. The query below returns the best match:
select top 1
from Products
order by (65*65)/nitro + water/170 desc
|
|
|
|
|
Hello friends,
Recently, I have cleared MCTS(70-502)-WPF certification, and have already cleared the MCTS(70-536) which credits to a MCTS certification to me now.
Now, I have been looking forward to MCPD. As there are no training kits/books available for MCPD, as is present for MCTS.
Need some guidance in preparing for the MCPD exam. I do not have much experience in designing the applications and wanted to learn the same.
Please guide me on how to develop an appetite for designing the application without losing focus and which are the best books/tutorials to refer for designing a GUI windows based applications. Also, how to prepare for MCPD.
Apologies if I have posted this question in the wrong forum.
Thanks in advance,
Praveen Raghuvanshi
Software Developer
|
|
|
|
|
Rags1512 wrote: As there are no training kits/books available for MCPD
This list[^] would seem to contradict that assertion.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
Thanks Rich for the information.
However if you visit this page http://www.microsoft.com/learning/en/us/exam.aspx?ID=70-518&locale=en-us#tab3[^] , and move to the Preparation Materials tab, you can see that there are no Microsoft book available. I am basically targeting MCPD 70-518.
I would you appreciate if you can guide me in terms of MCPD 70-518.
Also, If someone can guide on how to learn and adapt designing of application.
Thanks,
Praveen Raghuvanshi
Software Developer
|
|
|
|
|
Sorry, but I don't work for Microsoft. The link I gave you was the result of a Google search which offers various web sites with information that may help.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
I was reading a coding style document put out by a certain company, when I came across an odd claim in their justification for their FOR loop style. I was wondering if someone could shed some light on this for me:
The document states that a pre-increment operator is preferable to a post-increment operator because post-increment introduces potential inefficiencies when iterating over an object. The example they give is C++ code:
std::vector v;
for (std::vector::const_iterator i = v.begin(); i != v.end(); ++i)
{
}
...and an identical sample that uses "i++" instead of "++i" for the increment operation.
I see no difference in the efficiency. Whether using ++i or i++, "i" is going to contain its new value before the termination condition is evaluated. The loop will be iterated an identical number of times.
I was wondering if someone could shed some light on what it is that I'm missing here, or if perhaps the assertion that pre-increment is more efficient. Is there some other language or platform that treats identical FOR loop sytax in a wildly different manner?
|
|
|
|
|