|
Perhaps I'm missing something in your question, but why would you want to instantiate the controller from different forms? This negates the usefullness of the MVC pattern.
What you really want to do is instantiate your controller in one place and then *pass* that around as you need it. I usually use a Mediator class to handle this. The Mediator is responsible for instantiating the controller, and contains the reference to it. The controller is made available as a property from the Mediator.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Model View controller is a set of patterns, and has been implemented in many ways.
The main idea behind a MVC is you seperate your view (Screens) from the model (Business Objects) through a center controller. Other patterns can be used here to further abstract the connections, but to keep things simple a good way to accomplish this is to first understand that your screens should know nothing of the business objects.
A central controller class is usually constructed to support the "awareness" of the eventing on the view (screens). The controller then wires up to the business objects to do the work.
Eventing, Interfaces and sometimes other design patterns are used for this "wiring" of abstraction between the view of the model.
For instance, I've just completed a project in which that I implemented a MVC. I added an additional layer of abstraction using a Command pattern.
This pattern, when implemented on the Controller and the View, gives a very abstract way of defining actions. Within the view, I constructed CommandAdapters that adapted each of my commands to the controller. The controller also used the commands for communication back to the view.
There is alot of debate in the industry on the best ways to create n-tier applications. I've learned that if an application is going through alot of changes, and new enhancements are readily being introduced. Then it is worth the extra time architecting a sound MVC approach.
However, if the project is simple, doesn't change much, or there isn't enough funding available. Then using agile development techniques is the better bet.
Hope this helps!
~ CodeDoctor ~
|
|
|
|
|
Hi Guys,
I'd like to make a blog / forum web app as research, and i'd like to use the (Sql)MembershipProvider to manage my users, but i'd like to tie Permission information to them.
I had a few ideas, but wondered what the standard was -
1) Add a permission indicator to the Comment field
Thoughts: Cheesy as hell, not particularly scaleable or searchable.
2) Create a seperate database and create both users at the same time.
Thoughts: Seems nice on the surface, but i would be maintaining two databases, one with login credentials, and one with the user and additional data.
3) Extend the existing SQLMembershipProvider database to support permissions, and expand the "User" object to include permission level.
Thoughts: Work, maintainability, and sabotaging something that already works. Plus, i would have to integrate both the DB's above, into a single entity. Doesn't scale well with the a permissions table either.
4) Seperate databases, like option 2, only with a Permissions table.
Thoughts: Heavy work, i'd need to do some more research into permission sets, but I suspect this is probably how things are done at the moment.
Hope you guys can shed some light on this.
Regards
Tristan Rhodes
-------------------------------
Carrier Bags - 21st Century Tumbleweed.
|
|
|
|
|
|
Awesome - Didn't even know it existed
Thanks.
Tris
-------------------------------
Carrier Bags - 21st Century Tumbleweed.
|
|
|
|
|
No bother - we're here to help.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hi all,
We would like to implement/integrate digital signature solution with third party document management solution(which has Rich API). We looked at commercial digital signature solutions and it looked like they are not affordable at all for Non-Profit org in India.I'm lead developer on this module.
Reuirement-
- Web signing: Sign documents(Doc,XLS,PDF,Tiff) online from ASP.NET DMS solution), they have viewer
- Offline verifiablity : When documents are sent via email to someone outside organisation, how they can verify that document is from outside source.
My Findings-
- We can use Crypto API / CAPICOM to get certificate and sign it and put signature embedded in Doc,Xls,PDF file.
- For offline verifiablity who does not have DMS solution, some thick app could be given who looks for signature in Doc,Xls,PDF file and tells signer, CA, Sign date.
Problems-
Embedded signature : Client need to have Office installed to sign document, even though he does not need to edit document.
Detached signature : Document can not be verified outside Organisation or DMS solution.
It looks like I'm missing something, please shad some light or just share your views on it.We are free to dig if theres any open source API to do this.
Thanks,
Maulik.
We all are angles with only one wing, only way we can fly is to cooperate.
|
|
|
|
|
Maulik,
Try looking at TOPAZ.
They offer a full programable API and electronic clipboards for a very reasonible price. http://www.topazsystems.com/Clip_Gem/[^]
I've used these for years in the medical industry for physician's and nurses, and they're API is easy to learn.
Hope this Helps!
~ CodeDoctor ~
|
|
|
|
|
What is the definition of "Software Architect"?
What does he do exactly?
Thank you,
M. Derbashi
|
|
|
|
|
|
A man who designs smooth buildings!
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
I think there is not just one defintion, but hundreds of what a software architect is... or software architecture. Possibly one understaning is that a software architect does the "global/strategic design" and lays the the foundation for used processes/organisation.
|
|
|
|
|
One good thing to read that is focused on just this is Microsoft's architecture journal[^].
In issue number 8 they started a section where they interview architects about their work and the roles they play withing companies. Really good read and should give you some perspective.
_____________________________________________________________________
Our developers never release
code. Rather, it tends to escape, pillaging the countryside all around.
The Enlightenment Project (paraphrased comment)
Visit Me at GISDevCafe
|
|
|
|
|
Guys
There are regular situations in the code base i am working on where exceptions are thrown but nothing is done with them. The end result is vague exceptions being caught at the top level with no information regarding what went wrong.
As a result, i have begun catching them, adding data relevant to the location where they were caught, and re-throwing.
In some cases the same exception can be caught and re-thrown 4+ times. I know exceptions are slow, but what are the other options?
Note: Generaly these exceptions shouldn't be thrown that often and are a vital debug tool
Regards
Tris
|
|
|
|
|
Tristan
I think you have to ask yourself why you are rethrowing an exception so many times. Exceptions serve the purpose of allowing you to deal with a problem as soon as possible. The further up the trace strack you go, the lower the value of the exception becomes. For instance, suppose that I'm trying to open a file. If the file isn't present, I should expect to receive a FileNotFound exception. Now, this shouldn't bubble back up the chain because there is less that I can do with it at each stage back up the stack. What I should do is handle it at the point that the exception was first caught.
Now, why are you catching exceptions? Generally this is because you either want to be able to handle extraordinary conditions gracefully, e.g. don't attempt to read the file in if you receive a FileNotFound exception, or because you want to capture the fact that your code failed. In the first case, you want to handle the exception and move on. In the second case, you want to identify what happened where. Throwing it back up the chain isn't going to help you one bit in the second case. What you should really look at is implementing some form of logging mechanism and use that to log exceptions.
Finally - only rethrow an exception if there is value in doing it, e.g. by breaking the normal program flow to cater for exceptions.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Excelent, thanks.
Food for thought.
It was option 2 actualy, but there are an excessive quantity of Try / Catch blocks in existance which do nothing. I'm actualy trying to bring order to chaos and have a good clean up of an existing code base that throws meaningless errors.
Cheers
Tris
-------------------------------
Eats: Software
Sleeps: Software
Drinks: Decaf
|
|
|
|
|
How can I restrict read and write permission on USB drive on windows xp using WINDOWS API...?ANY help wil be appreciated..
|
|
|
|
|
Sounds like something that can only be done from the admin level.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
|
|
|
|
|
How can I restrict read and write permission on USB drive on windows xp using WINDOWS API...?ANY help wil be appreciated..
|
|
|
|
|
Hi to all,
i have developed solution for bookkeeping agency.
There are a lot of inserts in database (two tables header and details) from many points (10-15-20). Operators are inserted documents with 10-20(50 or 100) items. At the moment, mine solution is insert in database a each row of data as it is comlete and just after insert there is select wich retrive data from database. With this i have data in scope of everyone, but as it is very frequntly it is so SLOW. After each row select(with several 9-10 joins) retrives more and more data. Mine other idea is that operator is working in local and when is finished with a document then to lounch insert in database.
With this i will bypass continual rounds throuh server, but data will bee in scope just after inserting whole document ...
I need some instructions about solving this bussiness task.
I'm working with sql 2000 and vb.net
Thanks to all
|
|
|
|
|
alexrad wrote: i have developed solution for bookkeeping agency.
alexrad wrote: I need some instructions about solving this bussiness task.
Well at least you have selected the appropriate time to consider this...
led mike
|
|
|
|
|
|
Hi,
Has anyone implemented the design patterns from www.dofactory.com?? If so, what are your comments on these design paterns??
I am an established .NET developer with lots of development experience behind my name, but I want to take my development skilss and the way that I do things to a next level.
I am working through their design patterns, and I want to use Microsoft's Membership provider. I have used this alot in the past by just coding everything. Is there no better way of using their loggin system with design patterns? If so, please can someone advise??
Regards
ma se
(South Africa)
|
|
|
|
|
Whenever I need a quick refresher on the intricacies of a pattern, I head to Dofactory. While I find their online examples are a bit contrived and a bit limited, their UML diagrams are spot on.
ma se wrote: I am working through their design patterns, and I want to use Microsoft's Membership provider. I have used this alot in the past by just coding everything. Is there no better way of using their loggin system with design patterns?
The Membership Provider is based on a design pattern. It's called the Provider pattern.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Thanks.
Are you very familiar with patterns??
Do you know if there are any sample web apps, besides the Do Factory website, that shows exaples of how patterns are used?
Would you recommend any good reading material with patterns and .NET 2.0?
Cheers.
|
|
|
|