|
I am planning to develop medium size library project for personal purpose. After documented the requirements, I designed an entity diagram. Now I am planning to define all classes, structs, enums and function body before coding the logic. As per my vision this method will help me to identify problems at the beginning, so that I can save the time to rewrite the logic. Is this a standard methodology? Is there any pre-defined method to do this?
Thanks and regards,
Thomas
|
|
|
|
|
Well, it's an interesting approach and an admirable one. Unfortunately, practical experience shows that the reality will fall short because requirements change as most projects and a rigid approach means that it is harder to adapt to these changes.
I prefer, now, a more fluid approach such as TDD coupled with SOLID architecture, which makes it easier to work with isolated simple to use classes.
|
|
|
|
|
But this is for my personal use. I am the coder and client So I am well aware of requirements. So are despite these problems, are you suggesting me to follow this mythology? Can you please suggest me any good read about this?
|
|
|
|
|
popchecker wrote: So I am well aware of requirements.
Are you - you're a much better person than me then ? Even on personal projects, I've ended up changing requirements as things have evolved.
There are plenty of articles here on Code Project and the web about TDD, I'd start off with general purpose articles if I were you.
|
|
|
|
|
I salute your discipline, I have yet to create a design specification before the project is at least 80% done. A personal project tends to start as a data structure and flows naturally from there. If I screw up the structure I just fix redesign and move on.
I use my personal development projects as learning experiences, usually built in a new tech/language so doing a bunch of design stuff before building it just seems silly. Data structures are pretty standard across all platforms but the internals of the app tend to be quite fluid.
I am lucky in that even at work I can just build the solution and then create the doco after the fact (or not if I'm really lucky) after all my work projects are ALL POCs
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
This is about the same for me.
For personal projects I tend to change design even more often as there is no one else involved I first have to consult with.
So, while coding I end up noticing a different approach might be better after all, etc. and change the structure.
When I learned programming they certainly did hammer into my brain that it's imperative to create detailed design sheets beforehand, but from my experience you should never go too much into detail unless required client side as it makes you far to inflexible.
And once you started changing designs, you should wait to change the documentation until the project is done or otherwise you end up wasting time to redo the documentation every time you change something.
I think it's best to design a concept and basic classes/methods beforehand and then fill in the rest when you really have coded it to not end up documentation a program that never came to be.
|
|
|
|
|
lol 80% done. I only laugh because personal or professional, that's probably the honest truth.
Architecture is extensible, code is minimal.
|
|
|
|
|
If you are doing this for learning purposes, then I would say this is not a bad idea. For someone who is learning OO programming, I think it can be useful to sit down and draw out the class structure first because it helps them learn to think in terms of objects and how they interact. Experienced programmers can get away without doing this because they have the experience to know what the rough structure of the classes should be, and they can evolve that as they go. Newbies don't have that depth of knowledge to draw on so they can easily end up with a huge ball of mud that sort of works but isn't maintainable.
I don't think you need to go right down to the level of detailing the function bodies and so on, but sketching out a class diagram will help to get things clear in your mind before you start and make sure that you can see the wood for the trees when you find yourself buried in the coding phase. But don't be afraid to deviate from it when you are coding if you find a better way to do things once you get started. It's a guide to help clarify your thinking, not a rigid plan to be mindlessly obeyed.
It depends on how experienced you are at designing and building this sort of application.
|
|
|
|
|
Hello,
I am having little design problem: I have one factory which will create object of with one type or another type. But my client requirement is to give(feed) the data(via setter methods) from outside world to the concrete class of type-1 not for type-2.
If I place these setter methods in interface, those need to be implemented forcefully both of concrete classes. This is NOT my requirement. I want to feed 1 kind of data for 1st type(some setters) and want to give another kind of data for other type(probably different setters other than which's contained by previous type.)
e.g
class ISubjectExecutor
{
public:
virtual void ISUBJECTEXECUTOR_EXPORTS_API Execute()=0;
};
class COMExecutor: public ISubjectExecutor
{
public:
virtual void Execute()=0;
void setCLSID();
void setGuids();
};
class Win32Executor : public IWin32Executor
{
public:
virtual void Execute();
void setFilePath();
};
Now here I can't use pointer of ISubjectExecutor (*pSubjectExecutor) to call setter methods of Win32Executor or COMExecutor on my choice at any time after reciving pointer(ISubjectExecutor) from factory. Because those all setters never exist inside ISubjectExecutor interface, and you can't access any method which's never contained inside interface and exist in concrete implementation.
How to tackle this design problem to solve.?
Regards
Usman
|
|
|
|
|
struct IParameter
{
int m_ID;
virtual ~IParameter(){}
};
class IParameterSetter
{
public:
virtual ~IParameterSetter(){}
virtual int SetParameter(IParameter *pParam) = 0;
};
class IFactorySpecific
{
public:
virtual void Execute()=0;
};
class ISubjectExecutor : public IFactorySpecific, public IParameterSetter
{
public:
enum PARAMETERID
{
ID_CLSID,
ID_Guids
};
struct CLSID : public IParameter
{
CLSID(){m_ID = ISubjectExecutor::PARAMETERID::ID_CLSID;}
int a;
.....
};
struct Guids : public IParameter
{
Guids(){m_ID = ISubjectExecutor::PARAMETERID::ID_Guids;}
int x;
......
};
};
class IWin32Executor: public IFactorySpecific, public IParameterSetter
{
public:
enum PARAMETERID
{
ID_FilePath,
};
struct FilePath : public IParameter
{
FilePath(){m_ID = IWin32Executor::PARAMETERID::ID_FilePath;}
char cszFilePath[260];
.....
};
};
class COMExecutor: public ISubjectExecutor
{
public:
int SetParameter(IParameter *pParam)
{
switch(pParam->m_ID)
{
case ISubjectExecutor::PARAMETERID::ID_CLSID :
ISubjectExecutor::CLSID *pData = (ISubjectExecutor::CLSID *)pParam;
return ...;
break;
case ISubjectExecutor::PARAMETERID::ID_Guids :
ISubjectExecutor::Guids *pData = (ISubjectExecutor::Guids *)pParam;
return ...;
break;
}
}
virtual void Execute(){.........}
};
class Win32Executor : public IWin32Executor
{
public:
int SetParameter(IParameter *pParam)
{
......
......
}
virtual void Execute(){.........}
};
IFactorySpecific *pExecutor = Factory::GetExecutor("COMExecutor");
ISubjectExecutor::CLSID stParam;
stParam.a = 10;
pExecutor->SetParameter(&stParam);
IFactorySpecific *pExecutor = Factory::GetExecutor("Win32Executor ");
IWin32Executor::FilePath stParam;
strcpy(stParam.cszFilePath, "c:\\abc\\xyz.exe");
pExecutor->SetParameter(&stParam);
Sameer();
|
|
|
|
|
I realized, If I don't serialize the undo queue now it may never find its way into the project (much like undo and redo finding its way into the project).
Are there other things like this that need to go in early or else you're, you know what?
|
|
|
|
|
Deciding if you want your server error (WCF) reported to the client. If you are passing objects/lists they will be strongly typed, if you need to pass back an error object then you are passing vanilla objects.
We decided what breaks on the server stays on the server.
Error trapping in general, you do NOT want to have to touch every method and class after you decide on your strategy.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I have a requirement that, the text of the controls and other hardcoded values in the application (for eg. exception message such as user friendly message etc.) will be stored and read from database. This requirement is not mandatory,but if present, it will be good.
If provided, the user can go and edit the text whenever he wants.
So I am thinking of what is the best approach of doing this. I can just store it and retrieve from sql query or stored procedures. But, that I think is ugly way of doing it. Is there any other better approach? As I am using ASP.net 3.5 version, I don't want any performance degrade of the pages because of this process.
Could anyone please provide some suggestions or guide me toward some good articles? I searched in google but couldn't find an effective one.
Thanks
meeram395.
Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|
|
meeram395 wrote: Could anyone please provide some suggestions or guide me toward some good articles? I searched in google but couldn't find an effective one.
This[^] article on MSDN might help to move all the texts to the database.
You'd still have to provide the user an edit-screen to manipulate the database-texts, and I think that changes wouldn't be visible until you restart the application.
I are Troll
|
|
|
|
|
you can store the value in a SQL Server Database table. Cache the data in application startup using ASP.NET cache engine. Make a SQL Server invalidation cache dependence over the cache, so whenever user changes the value in the table the cache gets invalidated. Repopulate the cache when there is a change in the underlying data table in SQL Server. So you are not pulling the data from SQL Serevr each time and only refresh the data in the cache whenever there is a change in the underlying data...as well as there will be no application restart requirement...a the cached data gets refreshed whenever there is a change in the underlying table....for information on SQL Server invalidation please refer the following link
http://www.wrox.com/WileyCDA/Section/Using-the-ASP-NET-2-0-SQL-Server-Cache-Dependency.id-306459.html[^]
|
|
|
|
|
In visual c++. I want to make a compiler code that search for the $ and then again search for the another $ sign and delete anything between those two $ signs and saves new file called anyname
thx
|
|
|
|
|
interesting
|
|
|
|
|
Yes seems interesting but Need Help getting it done
|
|
|
|
|
mohit`12 wrote: but Need Help getting it done
Since you did not explain where it is that you want to search, i.e. your question is rather vague, it is difficult to offer more than a vague suggestion.
Try this:
Look at each character in turn and when you find a '$' sign make a note of its position. Then continue searching for the next one until you reach the end. If you find a second '$' then remove all the characters between the two positions. Where is the difficulty?
It's time for a new signature.
|
|
|
|
|
Use a regular expression to do this. It's hardly something for this forum though, is it?
|
|
|
|
|
Any1 got suggestion for Best open source UML tool.
thx
|
|
|
|
|
For a free one, you can't go far wrong with StarUML[^].
|
|
|
|
|
|
I managed myself using StarUml and everything worked well so far. seems like that's the only one best open source tool out there in market...
but no doubt on using IBM Rational it's best in all way but it's not free
thx
cheers from canada.
|
|
|
|
|
mohit`12 wrote: no doubt on using IBM Rational it's best in all way
Dear lord no. Enterprise Architect is a much better (and friendlier) solution.
|
|
|
|