|
I would just like to run my business process, for registering new members on a web site, by the readers here and invite comments on my first of such a design.
My Member class has PendingReplyId (a GUID) and PendingReplyRequestTime properties. After validating details of a new member, such as unique username etc. I create a new member record with a new reply id and request time, then email the new member a URL containing the reply id. When the member clicks that URL, the reply id is passed to my confirmation page. There I try and find a member based on the ID, check if the ID has timed out, and if all is well I mark the member as Approved.
What say you all? I know I should really factor out the reply id's and times into a separate table, but they are only ever used for Member replies, and only for one task at a time. What else could or should I be doing differently?
|
|
|
|
|
I have develop a web based Accounting and Inventory Software. How I can Market it?
|
|
|
|
|
Create a website for it!
See if you can crack this: b749f6c269a746243debc6488046e33f So far, no one seems to have cracked this!
The unofficial awesome history of Code Project's Bob!
"People demand freedom of speech to make up for the freedom of thought which they avoid."
|
|
|
|
|
Hire someone to sale/market it.
This is not a technical question and thus it is not the right forum for such question. This fits in for a discussion and pick Lounge or similar forum for the same.
|
|
|
|
|
What is a book that comprehensively treats design principles such as:
1. Open/Close Principle
2. Liskov Substituion Principle
and others like these. I know Heads First Object-Oriented Analysis and Design has a chapter on this, but is there a whole book dedicated to just design principles? Or at least a book that provides more material than Heads First. There ARE books available on design patterns but I can't find ones on design principles...
|
|
|
|
|
|
Code duplication really frustrates me. Is it just me, or do others feel the same? What I'm thinking about is when somebody has clearly copied a chunk of code, and then changed a few lines in the new version. Duplication seems to always cause problems.
Some people just don't seem to see the problems though. They will copy code without thinking about it, and give you a puzzled look when you say something about it. It always seems to be somebody else who either has to suffer or spend time refactoring it. In my opinion it's just a 'hack'.
|
|
|
|
|
Member 4487083 wrote: Is it just me, or do others feel the same? What I'm thinking about is when
somebody has clearly copied a chunk of code, and then changed a few lines in the
new version. Duplication seems to always cause problems.
It really depends what you're talking about. DRY just means don't repeat yourself. If the code you've taken is from the web, then modifying it to suit your needs is perfectly acceptable. I do agree that it's a PITA when somebody copies and modifies code that they don't understand (we see plenty of that in the forums).
|
|
|
|
|
Pete O'Hanlon wrote: It really depends what you're talking about. DRY just means don't repeat
yourself. If the code you've taken is from the web, then modifying it to suit
your needs is perfectly acceptable. I do agree that it's a PITA when somebody
copies and modifies code that they don't understand (we see plenty of that in
the forums).
Copying snippets from the web is usually ok. Although I would expect somebody to copy a block of code from the web and paste it in many places. Unless it's a simple, single line of code then it should probably go into something like a function/method. I don't think I've seen cases where people don't understand the code that they copy, but I'm sure it happens.
|
|
|
|
|
Member 4487083 wrote: I don't think I've seen cases where people don't understand the code that they
copy, but I'm sure it happens.
You obviously don't spend a lot of time answering questions in the forums here then.
|
|
|
|
|
Pete O'Hanlon wrote: It really depends what you're talking about. <layer>DRY just means don't repeat yourself. If the code you've taken is from the web, then modifying it to suit your needs is perfectly acceptable. I do agree that it's a PITA when somebody copies and modifies code that they don't understand (we see plenty of that in the forums).
In that case, you're repeating someone else. Having the same method repeated in your project would be a duplication, giving you two places to maintain that offer similar functionality.
I are Troll
|
|
|
|
|
I know what DRY means. I was just clarifying it because the wording could have been taken that way.
|
|
|
|
|
No offence meant, sorry
|
|
|
|
|
None taken. I thought I'd better put my reasoning there why I clarified.
|
|
|
|
|
|
It happens a lot when the KPI is the number of tasks completed. When you see someone doing it all the time and their KPI and wage is twice that of anyone else, you got to ask yourself is DRY worth the cost to you personally.
"You get that on the big jobs."
|
|
|
|
|
RobCroll wrote: It happens a lot when the KPI is the number of tasks completed. When you see
someone doing it all the time and their KPI and wage is twice that of anyone
else
That's a very interesting point, I don't know whether our KPI's are based on the number of tasks completed. There certainly are times where people seem to checkin bad code, and are unable to explain why they did it. However, I don't think the management would have a rule like this. They are trying to improve the code quality, although there is always a drive to get work done quickly.
RobCroll wrote: you got to ask yourself is DRY worth the cost to you personally
Well, I suppose you need to decide what is most important to you. Do we want to be software developers or hackers? We spend a lot of our life working, so I want to make sure that I enjoy my work. However, if you're in a company that has bad KPI's then it's probably best to find a company that doesn't. I think it's probably hard to find a company with a good development team though
I'm a developer because I enjoy developing software. It's becoming more difficult for me to enjoy it when I know that the code is full of rubbish. I sometimes think that a management/teamleader position would be a better place for me because I could have some influence over the quality without actually having to work with the rubbish. Maybe small companies (with a one or two man team) are the way forward.
|
|
|
|
|
I am an almost religious advocate of the DRY principle (I have broken it a few times but either through extreme need or the decision wasn't mine to make.. and believe me, in that case, i fought it bitterly)
In my experience, there are a LOT of developers out there happy to throw the DRY principle away and they cite the following excuses:
- Time constraints
- Budget constraints
- Too high impact on existing (flawed) design
- Inexperience (excuse usually given by someone else on their behalf)
Personally i find i generally design a system in my head, then as I'm coding it spot areas where I'm in danger of breaching the DRY principle and, in rooting these out, a better design surfaces.
I guess there are two types of developer, the first measures their success in designing and building an application by the elegance of the end design and its adherence to good coding practice, the second measures their success by meeting performance targets.
I have worked in environments where some developers were bringing in unmaintainable messes early and under budget and were praised by the PHBs as examples for the rest of us coders (scraping by the budgets with elegant solutions)
Sloppy coding can give you a short-term gain, but its gonna bite you in the arse eventually
IsRanting = false;
|
|
|
|
|
I'd like to gain an overview of the whens and whys about state specifications/implementations.
How do you go OOP when specifying states? Or do you prefer an enum? ints? ...
References are also appreciated.
I am very mixed about this topic, so you will get no religious opinions from here.
Thanks!
Keld Ølykke
|
|
|
|
|
I'll go for enum over int every time because there probably isn't going to be billions of states and by strongly typing the values, it makes the design a lot more robust and maintainable. MyState.Enabled as opposed to 1 is a lot easier to work with.
"You get that on the big jobs."
|
|
|
|
|
|
Hi All,
I am developing a library component which requires some global settings. Personally I don’t like to maintain an xml configuration file for this.
An idea strikes for me that to write an abstract class with an abstract method which can override and set global setting by the implementers of this library.
The abstract class will look like something like this.
public abstract class LibSetting
{
public int MaxCount { get; set; }
public abstract void SetCount();
}
The end users will implement this abstract class in their application is as follows.
public class MySetting : LibSetting
{
public override void SetCount()
{
MaxCount = 100;
}
}
To get the end user setting from my library, I am using following code.
public int ShowCount()
{
Assembly asm = Assembly.GetCallingAssembly();
IEnumerable<Type> types = asm.GetTypes().Where(t => t.IsClass && t.BaseType == typeof(LibSetting));
LibSetting setting =(LibSetting) asm.CreateInstance(types.First().FullName);
setting.SetCount();
return setting.MaxCount;
}
This will work perfectly. My doubt is that, is it feasible in architecture level of view? I think the performance of read an xml file and loading a class using reflection would be same ( I didn’t test it). So is this a good practice? Kindly advice me on this.
Thanks and Regards,
Kannan
|
|
|
|
|
Hi Kannan,
Your inheritance approach seems fine.
I have the following things that you can ponder about:
1) Isn't the user's call to a setter a little backwards?
Another approach is just to require a getter from the user's concrete class e.g.
public abstract class LibSetting
{
public abstract int MaxCount { get; }
}
2) Furthermore, you could supply the user with good default settings e.g.
public abstract class LibSetting
{
public virtual int MaxCount
{
get { return 100; }
}
}
Hope it makes sense...
Regards, Keld Ølykke
|
|
|
|
|
Hello,
I have been designing a cross-platform GUI application using JUCE framework and need some help in designing it.
The GUI will be used for configuring the hardware/device.
I did layering for the application as below.
- Presentation Layer
- Controller Layer
- Model Layer
- Communcation Layer
I’ll explain each of them as below.
Model Layer: It contains the actual data that is displayed in the UI and stored in the hardware/device.
For e.g Device Information (ID, Name, version number)
Presentation Layer: It displays the information present in the Model/Hardware or the information after being manipulated in the Model. Mainly, it acts a View.
Controller Layer: It controls the requests coming from presentation layer and hardware/model layer.
Communication Layer: It communicates with the actual hardware through some protocol and send/receive from/to controller.
So, the basic flow from UI to device will be
Presentation -> Controller -> Communication -> H/W -> Receive message from H/W -> Communication -> controller -> Model and Presentation
And reverse would be
Receive message from H/W -> communication -> controller -> model and presentation.
Here are my questions w.r.t design.
- Model will have entities such as Employee, Department which will be used inside the controller. Shall I create a EmployeeController and departmentController OR should I have a single controller class only
- If I wanted to show information of an emplyee in a department in UI, should I create corresponding views in the UI such as employeeView and departmentView.
- What patterns we can apply for different layers, especially for GUI
- Where should I write the observer pattern in order to update the UI when there is a change in the value of the Model.
- Appreciate if someone can provide me an example for Loosly coupled GUI application in C++ and that interacts with the hardware.
Please let me know for any clarification.
Thanks in advance for your time and effort.
Praveen Raghuvanshi
Software Developer
|
|
|
|
|
Looking for a third party chat service where site visitors can live chat with reps and during off hours have an automated response for basic visitor questions.
|
|
|
|