Questions tagged as 'design-pattern'

1
answer

Creation of anonymous vs. "named (?) objects"

I have a class that loga some information in the database I am using it as follows: new StudyLogRepository().Create(new StudyLog() { StudyId = Study.Id, CycleId = null, DateOccurrence = DateTime.Now, CycleActionName = "Nova estud...
asked by 08.05.2017 / 19:06
1
answer

Skyrim style item system

I'm developing a 2D RPG in Skyrim style C #, and I'm in the part of implementing the game items, but with a lot of difficulties. I wanted to do a Skyrim-like mechanic in which you have a range of items sorted in a variety of ways such as arma...
asked by 20.09.2016 / 07:15
1
answer

Standardization for MySQLi use

I am researching on the use of MySQLi and I have seen many articles, but each one always has some particularities about the pattern of development, my question anyone already set a default? For example something that can be followed with best pr...
asked by 04.03.2015 / 20:09
1
answer

Can we create the business rule in our model?

What best practice? Create the rule in the model itself or create another class Ex: public class Item { public void Faturar() { //fatura item } } ou public class ItemBLL { public void Faturar(Item ) {...
asked by 03.07.2014 / 21:23
1
answer

How to work with more than one dependency in Service class?

I have my class Service called GrupoService , in it are most actions that refer to Grupo . Crud(Inserir,Alterar,Excluir,Listar) The only dependency I have on my class so far is GrupoRepository . You also have in it...
asked by 16.09.2014 / 22:58
1
answer

How to add concrete elements in runtime in the visitor project pattern?

I have a question regarding Design Pattern Visitor . By my studies, if you want to add a new concrete element to the pattern you must add a new abstract method in the visitor interface and implement this method in the concrete visitors. Thi...
asked by 15.09.2014 / 19:40
1
answer

Design pattern for combining data coming from different Databases

I'm getting data from two different databases and need to format this data for Json. The problem is not accessing the two banks and picking up the information. The problem is that my class got more complex than it should have. One of my Json...
asked by 28.01.2016 / 14:43
1
answer

What is the correct way to declare the following class structure and get its behavior from EntityFramework?

I have the following class structure: public class Revenda { [InverseProperty("Revenda")] public virtual ICollection<UsuarioRevenda> Usuarios { get; set; } } public class Empresa { [InverseProperty("Empresa")] public v...
asked by 30.09.2014 / 23:30
1
answer

Validate with object annotations within a method

I have a JavaBean with several attributes, and they need to be validated. It has an attribute of type enum, and according to the value of this attribute, the object needs some specific validations, and there are validations that are independent...
asked by 26.07.2016 / 23:21
0
answers

Generic Repository with Dapper

I'm doing a test application where I want to see the performance and learn how to create a generic repository with Dapper, well I have some experience when I created a generic repository, but using EF6, trying to use the same logic made the cons...
asked by 13.12.2018 / 21:34