|
Hi,
Lets say I have a class called Person with properties Name, Age, Salary. I create a GUI form to show object of this class so users can do CRUD operations on it. Each property will have a textbox for manipulation. However, if my client adds another field to Person, lets say Phone Number, then I will need to modify the database, the data access layer, the class itself, and finally add another textbox to the GUI for phone number. My question is what pattern can I use to handle a situation like above when clients constantly change properties?
I am thinking of using MVC pattern but that will be for other reasons and will not help my question above.
|
|
|
|
|
CodingYoshi wrote: However, if my client adds another field to Person, lets say Phone Number, then I will need to modify the database
If your users are performing CRUD operations, do you even need a Person class? Why not perform the operations on the database itself?
As far as adding fields to a table, this represents changing the database schema. That's non-trivial; I'm not familiar with a pattern that somehow hides or manages those kinds of changes. They're fundamental and will require all the work you mentioned.
|
|
|
|
|
The way most "modern" (and by this I don't mean code generators) data layers perform the O/R mapping between the business object definitions and the database is by a set of metadata that describes how the fields match up. So when you add a "Favourite Colour" field, you add the field to the database. Then (either manually or automatically depending on your tool) add the field to your business object, and update the mapping. The mapping is then used to handle the actual queries at runtime.
A basic CRUD form could be generated at runtime using a similar set of metadata. Diamond Binding uses attributes on the business objects to say "this field comes from FaveColor" - you could use a similar strategy to decorate your business objects with "default view/controller" attributes - or chuck this mapping in a seperate file (probably a "technically" better solution than having your model aware of the default view/controller). You could end up with the class being decorated with [DefaultEditor(typeof(AutomagicCRUDController), typeof(AutomagicCRUDView)] and your new Colour field having a [FieldEditor(typeof(ColorPicker))].
Unfortunately I think you'll find that your clients will end up wanting minor changes to every form you show them, and you'll end up with something pretty close to doing it manually anyway. So my pattern tip is "Hire a load of graduates and get them used to the pain of dealing with clients"
|
|
|
|
|
Great. Thanks for the explanation and honesty.
I just thought I might be doing something wrong because a good design should not cause a ripple effect--I guess that is just "theoretically speaking".
|
|
|
|
|
The real problem here is that most clients think that a simple new field is something trivial to add.
But it's not because:
- How should it be presented in the UI (UI Layer)
- Do the validation rules checking the consistency change (Logic Layer)
- compatibility with old data (Logic Layer, DB Layer)
- Persistency impact (behavior of database, growth, indices, replication, transfer to data warehouse) (DB Layer)
And propably some more...
-^-^-^-^-^-^-^-
no risk no funk
|
|
|
|
|
Hrmmmm, it depends on how many business rules are coming with the new data. If a simple "data-only" field is non-trivial to add then you are probably using the wrong tools.
Of course, the client should have signed off on the domain model and user stories by then anyway, so for modifications at this late stage they are probably paying per-hour anyway... :P
|
|
|
|
|
You're right, if it is a simple data-only field, it should be simple. But in my experience, it is very seldom a data-only field (at least at the end when the customer says: "Oh, I thought it was clear that this and that business rules has to be changed because of that new field").
The result is some more iterations
-^-^-^-^-^-^-^-
no risk no funk
|
|
|
|
|
If its me ... I think I would solve this issue by using the concept of metadata ... the concept ! .. Well in this particular case I think I would use reflection and .NET Attributes ... reflection will help me to get the Fields (Person Class Properties) ... and .NET Attributes to determine which Fields shall be used ... for example
public class Person
{
private string name;
[Displayable]
public string Name
{
get { return name; }
set { name = value; }
}
private int age;
[Displayable]
public int Age
{
get { return age; }
set { age = value; }
}
private string officialID;
public string OfficialID
{
get { return officialID; }
set { officialID = value; }
}
}
Now the Displayable Attribute is a custom .NET Attribute you create ... using reflection I can determine whether this Field has the Displayable attribute or not ... and some kind of class will know how to map this class with its Displayable Fields to the UI for example ...
Hard ... but doable ... and in complex applications could lead to problems if its not designed well ... but mainly in rare cases like yours it could work depending on your business.
Sincerely Samer Abu Rabie
Note: Please remember to rate this post to help others whom reading it.
|
|
|
|
|
hi,
This should hopefully be my last question about my future hotel app.
The first time i built it, i made an insane amount of classes to encapsulate printing, and even then printing was messy.
I thought I could use crystal reports, but did a few tests and ran into some problems. It seems like its a nice thing when you want to just pull information straight from your database and print it but turns out pretty cumbersome when I want to use my own business objects as data for a report.
I know I can add a .NET object to the report via the database expert.But, there are problems when I need data from more than one object on a report. Also, I'm not quite sure how I could feed my own data to a chart in a report.
Is there any other printing/reporting scheme I can use? Or is there a particular design used with crystal reports, Printing is a very essential part of my app.
Thanks so much
Gideon
|
|
|
|
|
Previously I have suggested and recommended Logi Reports as a viable alternative to Crystal Reports.
Get it FREE here http://www.freereporting.com/[^] Caution, it is a fairly large download and there are plenty of tutorials and samples there also.
modified 1-Aug-19 21:02pm.
|
|
|
|
|
I used CR for many years and have always pulled the data from the database - just the way I design things I guess. All reports were serviced by a stored procedure so to deploy a new report required a proc and a RPT file, no recompile required. A hotel app will require an enormous number of reports and each customer will want custom reports done.
I liked it BC you could deploy it fairly simply (as opposed to Reporting Services) in a commercial app. I now do corporate work and use RS exclusively.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
thanks so much for replying, but someone on the Microsoft newsgroups gave me a work around with CR.
I make a new typed dataset for each report that I want to create, I have seperate tables for each chunk of data I need printed.Then I design a new report, when I need the data printed I set the datasource to a new instance of the typed dataset with all my data in it!
It works like a charm, also for situations where I've needed Multiple bunches of information all over the place, I use subreports, somehow the dataset passed to the first report is automatically passed to the subreports too, so it works pretty well.
Thanks!
|
|
|
|
|
Hi,
Actually Im a developer, But my Current role is to gathering requirement from user or customer or client .....Because Im working in a small company....
My specific role is to identify the different forms, reports needed for the analysing project.
while analysing forms or reports I need to know what are fields that going to appear on the form or reports...
So I need to interview the clients or user directly.
This is the situation
Now my question is like:
1) First I will probe the client for requirement, AFter that I will identify the forms needed for the project.
2) Now I need to capture the forms fields and what are the logic behind each forms rite, how to do that?
For eg: The client ask you to create a form with radio button, text box, tables, option button, label etc..
Radio button:
So client saying that I need to select 1 field out of 5 fields, So at this situation you can use radio button, But my question is like how to document it from user, And this document is easy to modify and also understandable by any developer to create.
Tables:
So client saying that I need 2 rows 2 columns and this are the heading, So at this situation you can use tables, But my question is like how to document it from user, And this document is easy to modify and also understandable by any developer to create.
So actually I need different kind of template to capture the requirement for Form, reports etc.. from user or clients, or customer....
remember :We are not developing, I just gathering requirement, I need to just document the requirement so any developer can understand and able to create. And also able to understand by client or customer or user to sign off.
Thanks in advance
Shaan
|
|
|
|
|
What is your backgound? I mean if you are a student of Software Development how are you not aware of Requirements Documents?
They are all over the internet including formal standards at IEEE. Anyway you can do stuff like this.[^]
led mike
|
|
|
|
|
Why do you think the client will know that they want radio buttons, etc? This isn't the way most users think. What you need to do, instead, is get the requirements from the user about what they are actually trying to do. Then, you may want to draw up some use cases to map the process from the users point of view.
|
|
|
|
|
This particular thread makes me wonder if there should be an article done here on requirements gathering.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
|
That's a nice find, Richard. It looks like one to definitely bookmark for reading later tonight
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
Hi all,
I'm struggling on how to set this up. I'm going to be building a web app that will be on our intranet (Active Directory security) to support some business function. Though there is a need to have external users get to the app from outside the intranet. For the sake of getting it out quickly, I'm thinking about just doing the intranet app minus external use.
What kind of things should I be be looking for if I tack on the external use feature after I finished with the main app? Should I be just including it from the start?
We also have Sharepoint 2003 which I'm strongly considering using since it already has links to outside our network. The downside to using Sharepoint is that I've never done anything in Sharepoint so the time factor goes up (learning and what not).
Thanks,
Keith
|
|
|
|
|
I have a specification of a framework for distributed applcations.
2.1. Canals/Ports paradigm
The general idea of the paradigm is building distributed application from components using canals and ports. Each component is an executable (running as separate process), that exposes several ports. Components can be run on different computers across network. Canal Manager Framework provides passing data from an output port of a component to several input ports of other components. Passing data from an output port to input ports provided with canals, connected with ports. Each canal connected with an output port and several input ports. The connection scheme of components is described with special Connection Scheme Description Language (CSDL).
For more information ask me via e-mail amspb1@hotmail.com
|
|
|
|
|
First, I think you mean "Channel" not "Canal". Second, what is the question here? You have a specficiation, great, but what are you hoping to gain by posting that specification here on CP?
Scott Dorman Microsoft® MVP - Visual C# | MCPD
President - Tampa Bay IASA
[ Blog][ Articles][ Forum Guidelines] Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai
|
|
|
|
|
I think he does mean Canal. After all, he talks about ports - I assume he uses a loch on it.
|
|
|
|
|
Loch free canals are generally faster, but more assymmetric. Its often slower to send things upstream. :P
|
|
|
|
|
You win.
|
|
|
|
|
http://www.codeplex.com/CanalManager/
|
|
|
|