WPF and MVVM tips [closed] - c#

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
I'm new to WPF and MVVM pattern. I've been reading about it and I come to a little doubt.
I'll build an WPF application that mainly does access to a database (oracle), but this access is done by an WebService (DataService). My question is in the Model part.
Should I create a class to each table on the database, on my Model, or should I just use the entities that the service provides me?
My guess is use the entities of the service, and then just do the CRUD operations in my application. But I want your opinion.
Thanks in advance.

It is always a good practice to use your own Models. That way, if the Service changes the structure, you will only need to change one point (where you map the item to your own entity), else you would have to change your whole application

Related

C# Optional params for build sql string best way [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 5 years ago.
Improve this question
i'm trying to see which is the best way or practise for sql string optimizations in c#, mssql. What i'm trying to do is like a crud system where we send the necessary required params such as db name and table and after we have the conditional, for example if its a remove action, we will have an where condition and it can contain more than 1 param so what i wanna know is get the whole params.
Should i accept an array with those conditions or what i must do.
Thanks
Not exactly an answer to your question but you should consider using ORM tool like NHibernate.
With NHibernate, you can accept QueryCriteria or ICriteria from outside world which will do the query accordingly.
Be warned that this will be big change in your application and NHibernate have steep learning curve.
There are also simple micro-ORMs available like Dapper. With it, you can implement Repository pattern by creating Data Access Layer. Refer this link.

Which class should be Singleton in WPF, MVVM structure? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I know my question is subjective and context dependent, but being a beginner to MVVM, I came to know that generally one of the MVVM class is made singleton. Can anybody please tell me if I have Model, ViewModel and View class, generally people prefer which class as singleton and why is it so?
Technically, the Application class is really the only "required singleton" in a WPF application, and that's mainly because WPF will create it for you.
Otherwise, I typically avoid singletons in my WPF applications completely - there is no reason to introduce them.

Use Cases for DebuggerStepThroughAttribute [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
Question is pretty straight forward. Are there any valid use cases for the DebuggerStepThroughAttribute? Valid in the sense that they'd be used in a development environment.
Losing 4 solid hours, only to find this attribute decorated on a class is rather disheartening.
I have used it when developing framework code, when the source code to the framework is in the same solution as the main application.
Basically when done with the framework code, I tag the appropriate classes or methods, so that if I, as an example, step over a method call up in the application code, it will not suddenly dive into tons of framework code before resurfacing in the application code somewhere else.
Makes it easier to debug the application.

For a CMS which one is better?MVC or MVP? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I am working in a company that wants to make a CMS program.
I say that the UI layer should be written with MVC but they say that MVP is better.
I dont know which one is good for this project or any other.
What do you think?
And they want to use WPF.
How do you think about WPF in a web project like this?
Thank you all.
Go to beside your management and say "be satisfy"
MVC is better thing.. :)

Does the SRP suggest that an MVP Presenter should only have one responsibility? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I have two features: one that presents the details of a single entity (EntityX) and one that allows the user to view a list of all EntityXs.
Using MVP, is it better to have an EntityXController with two methods (View and List, for example) that use the appropriate View and List views, or should I comply with my interpretation of the SRP and create an EntityXListController and an EntityXViewController to narrow the responsibilities of each?
That sounds more like same Model, different View-Presenter for Details, and another View-Presenter for List.

Categories