Questions tagged [decouple]

25 questions
10
votes
9 answers

Entity classes decoupled from LINQ to SQL provider for implementing the Repository pattern. How?

I have looked over the Repository pattern and I recognized some ideas that I was using in the past which made me feel well. However now I would like to write an application that would use this pattern BUT I WOULD LIKE TO HAVE THE ENTITY CLASSES…
Andrei Rînea
  • 20,288
  • 17
  • 117
  • 166
8
votes
2 answers

BEM and "active" classes / Decoupling HTML and JS

I've started using BEM methodology to decouple my HTML and CSS ... and it works pretty well most of the time. Even if its only your personal opinion, i would still like to know how others deal with this: Let's assume we need to build a simple…
mrksbnch
  • 1,792
  • 2
  • 28
  • 46
8
votes
2 answers

How to structure viewmodels with MVVMCross

I’m taking the first steps into the MvvmCross framework and I’m trying to decide the best approach in terms of project and classes structure. My biggest concern now is to decide how should I organize my viewmodels in order to share data between…
zleao
  • 445
  • 3
  • 12
3
votes
2 answers

Heroku - Declare it as envvar or define a default value

I am trying to run my Heroku app locally and followed the instructions from here. When I tried to run the following command: python manage.py collectstatic I've got this error: Traceback (most recent call last): File "manage.py", line 15, in…
2
votes
3 answers

C++ Callback -- How to decouple the call back type

For example, in the following pseudo code, Class B need to call A::Action() through B::m_cb member. The objective is, how to make a general, non-template Callback class, so "B" does not have to be a template, and the "CallBack" can hold any kind of…
John Crane
  • 371
  • 5
  • 14
2
votes
1 answer

Decouple SQL files and API models

Making use of the @BindBean annotation. SQL files reference fields by their name, and if one of these public facing field names is changed then the sql will need updated. However IDEs don't understand the context of the sql bound fields, so will not…
Zoidburg
  • 159
  • 8
2
votes
1 answer

Where to store Interfaces in a Decoupled Architecture in my C# Solution?

I know this question might seem to be answered before, but I feel that the answer varies from case to case, so after reading several posts, I'm not sure in my case which is the best for my architecture. I have a Component Library that has a Data…
DataAnalyst1
  • 147
  • 2
  • 12
2
votes
1 answer

How to decouple in this case

For example, the following snippet do these things: First reading data from database, then transform the data, and last write results back to database. More specifically: Read data from database and store them into class A record by…
rage
  • 21
  • 2
1
vote
3 answers

.NET: Subscribe to event, decoupled. IOC?

I am writing a service in .NET/C# that recieves updates on items. When an item is updated, i want to do several actions, and more actions will come in the future. I want to decaouple the actions from the event through some commen pattern. My brain…
Troels
  • 151
  • 4
1
vote
2 answers

Decoupling from 3rd party library

I am using a third party HTTP client to make GET, POST calls. I don't want to tie my code to this library. So I've decided to create an interface called HttpClient and an implementation of it called HttpClientImpl. One of the methods in the…
tattihead
  • 81
  • 2
  • 4
1
vote
2 answers

C# Loose coupling

I can't explain my problem in English. so let me show my situation. // in Main Project public class User { public int version { get; set; } } // in Common Project public class Service : BaseService { User _user; …
오범선
  • 35
  • 5
1
vote
3 answers

Decoupling communication between your Fragments and Activities

Scenario: you want to show a new Fragment via a click listener from within an adapter or view holder. Below are the two most common, decoupled approaches that I have seen in the past. I have noticed that they both tend to come with their own pros…
Ryan
  • 3,414
  • 2
  • 27
  • 34
1
vote
1 answer

How to de-couple js and angularjs

In order to avoid to rewrite all code when replacing angular with other framework, i wonder if there any solution to de-couple angularJS and JS? if yes, how to test them( because cant't use angular testing module anymore )?
bificoo
  • 11
  • 1
1
vote
2 answers

How can I use different subclass in different situation?

I have a dilemma like this: I have parent class MediaPlayer, then some subclass extends from it, let's say they are MediaPlayerSub1 MediaPlayerSub2 MediaPlayerSub3, all of they extend some differnt methods. In my client, I want use different…
roger
  • 9,063
  • 20
  • 72
  • 119
1
vote
1 answer

decoupled components passing result c#

I have a program that receives files from clients and do some operations on files and save them on disk or won’t save them. For decoupling of jobs, I created an interface named IFileEditor. Every component that do something on file, should implement…
Reza Akraminejad
  • 1,412
  • 3
  • 24
  • 38
1
2