Am I breaking OOP practice with this architecture?

I have a web application. I don’t believe the technology is important. The structure is an N-tier application, shown in the image on the left. There are 3 layers.

UI (MVC pattern), Business Logic Layer (BLL) and Data Access Layer (DAL)

The problem I have is my BLL is massive as it has the logic and paths through the application events call.

A typical flow through the application could be:

Event fired in UI, traverse to a method in the BLL, perform logic (possibly in multiple parts of the BLL), eventually to the DAL, back to the BLL (where likely more logic) and then return some value to the UI.

The BLL in this example is very busy and I’m thinking how to split this out. I also have the logic and the objects combined which I don’t like.

enter image description here

The version on the right is my effort.

The Logic is still how the application flows between UI and DAL, but there are likely no properties… Only methods (the majority of classes in this layer could possibly be static as they don’t store any state). The Poco layer is where classes exist which do have properties (such as a Person class where there would be name, age, height etc). These would have nothing to do with the flow of the application, they only store state.

The flow could be:

Even triggered from UI and passes some data to the UI layer controller (MVC). This translates the raw data and converts it into the poco model. The poco model is then passed into the Logic layer (which was the BLL) and eventually to the command query layer, potentially manipulated on the way. The Command query layer converts the POCO to a database object (which are nearly the same thing, but one is designed for persistence, the other for the front end). The item is stored and a database object is returned to the Command Query layer. It is then converted into a POCO, where it returns to the Logic layer, potentially processed further and then finally, back to the UI

The Shared logic and interfaces is where we may have persistent data, such as MaxNumberOf_X and TotalAllowed_X and all the interfaces.

Both the shared logic/interfaces and DAL are the “base” of the architecture. These know nothing about the outside world.

Everything knows about poco other than the shared logic/interfaces and DAL.

The flow is still very similar to the first example, but it’s made each layer more responsible for 1 thing (be it state, flow or anything else)… but am I breaking OOP with this approach?

An example to demo the Logic and Poco could be:

public class LogicClass {     private ICommandQueryObject cmdQuery;     public PocoA Method1(PocoB pocoB)      {          return cmdQuery.Save(pocoB);      }      /*This has no state objects, only ways to communicate with other      layers such as the cmdQuery. Everything else is just function      calls to allow flow via the program */     public PocoA Method2(PocoB pocoB)      {                  pocoB.UpdateState("world");          return Method1(pocoB);     }  }  public struct PocoX {      public string DataA {get;set;}      public int DataB {get;set;}      public int DataC {get;set;}      /*This simply returns something that is part of this class.       Everything is self-contained to this class. It doesn't call       trying to directly communicate with databases etc*/      public int GetValue()      {           return DataB * DataC;       }       /*This simply sets something that is part of this class.       Everything is self-contained to this class.       It doesn't call trying to directly communicate with databases etc*/      public void UpdateState(string input)      {                  DataA += input;        } } 

Can you shorten a search time by breaking the search set into smaller groups?

Say you have an 8-bit binary number for which you have to guess the value but you are given only six tries. So, you try two methods:

1) Guessing the whole number gives a probability of a correct guess of 6/256 = 2.3%.

2) Break the number into two 4-bit groups and try guessing 3 times for each one. So, the probability of a correct guess is 3/16 * 3/16 = 9/256 = 3.5%

If you are given validation for each sub group, say you are told after the second guess of the first group that sub group guess is correct. Wouldn’t that shorten the search time for the rest of the number?

Is this right?

Best tools and equipment to digitise film negatives with DSLR, without breaking the bank

I am considering buying Lomography DigitaLIZA film masks for both 35mm and 120mm film to use within my digitisation process, however I am unsure of the best methods around the other areas of my process.

I struggle for back-lighting of the negatives mainly. I have an iPad in which I initially used, showing a blank white screen with my film negative on top and a glass/perspex sheet on top to flatten out. However, I found that upon inspecting the photos of my negatives, I could actually see the pixels of the Retina display in the whiter areas. I have gotten better results with no pixels in the background when lifting the negatives up, away from the screen and resting the setup on top of say a cardboard box, however this can sometimes lead into another problem… Making sure everything is level.

I have seen people use copy stands and film viewing light panels, but from what the products I have viewed this can start to incur great cost.

Does anybody have similar experience with digitising film negatives and a way to do it without breaking the bank?

Gnome Tweak: Bug Adwaita-dark theme breaking browser styles

I faced a bug today after installing Gnome Tweak.

How to reproduce it ?

First of all Install Gnome Tweak under Ubuntu 18.04.

Go to Appearance > Themes > Applications

Default is “Ambiance”, now change it and select Adwaita-dark

Adwaita-dark theme

I asked a friend to try the theme Adwaita-dark too but he didn’t faced this issue at all, by doing the same procedure. He don’t have any problems

Some screenshots

Themes Application “Adwaita-dark”

enter image description here

enter image description here

enter image description here

Themes Application “Ambiance”

enter image description here

enter image description here

enter image description here

For a cipher school challenge I need help breaking this cipher

[CIPHERTEXTSTARTS]HI wsndtonInehbihs if at t iyoncniegtrf .e noionbpni y,iu.w ahoui hs hroyh!euecsy m.ot ew hrc hb;ntsresnmdma ipMsat ln ts , ryiceg ensh c n byr t k t oe de uhw stiytoer s eevlde utln a lerytkhhte ae srdaBry,etyofattu.ttd t?ybor ubeusf elog oentiyrueeruuuemcndu ’naIlaow ystal nta.mAy dt ddin aoa,’une yeof hct dsirnetso lruohwpo ctoioa oyif awtowsrdupttep nm aIraulnhiebW ynoi[CIPHERTEXTENDS]

Strip breaking phenomenon in the Gromov compactification of Moduli space of Pseudoholomorphic curves

As the title suggests, I want to understand the strip breaking phenomenon that happens when I Gromov-compactify the moduli space of pseudoholomorphic curves from the holomorphic strip $ \Bbb R \times [0,1]$ into a symplectic manifold $ (M,\omega,J)$ . We require that these curves sends $ \Bbb R \times \{0\}$ to a Lagrangian submanifold $ L_0$ , and similarly $ \Bbb R \times \{1\}$ to a Lagrangian submanifold $ L_1$ . Let $ p,q \in L_0\cap L_1$ , we require that $ u(s,t)\to p,q$ for $ |s|\to \infty$ .

(From Auroux notes)

As far I understand (See here bottom of page 9) the strip breaking phenomenon appears when the energy of my family of $ J$ -holomorphic curves $ \{u_n\}_n$ is moving towards both ends of my strip. Intuitively I can (somehow) see what’s going on, by either reparametrizing the strip to keep one of the two concentrations of energy fixed at the origin and let the other go to the end I somehow see 2 strips.

I would like to formalise this procedure and actually see the strip breaking

Here is my attempt: Let $ \{a_n\}_n \subset \Bbb R$ be a sequence converging to $ +\infty$ , and let $ \{ b_n\}_n$ converging to $ -\infty$ . Assume that the sequence $ \{ a_n\}$ is such that it moves the energy concentration going towards the $ + \infty$ end of my strip, back to the origin. Similarly for the sequence $ \{b_n\}$ and the other energy concentration.

I think what we want to consider are the two limits \begin{align} &\lim_{n\to +\infty} u_n(s-a_n,t) \&\lim_{n\to +\infty} u_n(s-b_n,t)\end{align}

Under the assumption (which seems to me quite reasonable) that both limits converge uniformly to functions $ w(s,t)$ and $ v(s,t)$ . I want to see now their behaviour near the ends. To this end we compute
\begin{align} &\lim_{s\to +\infty} w(s,t) \ &\lim_{s\to +\infty}\lim_{n\to +\infty} u_n(s-a_n,t)\ \end{align} If I’m allowed to exchange the order of the limits (which seems the case since I asked for uniform convergence) then it’s easy to see that $ v$ tends to the constant maps $ p$ or $ q$ near the ends of the strip, similarly for $ w$ . On the other hand, the typical picture for this situation is the following from Auroux notes

which doesn’t exclude the possibility that $ r\neq p,q$ .

Therefore I must do something wrong in my visualisation process. Can someone help me seeing the strip-breaking process more clearly/formally?

How to “open interfaces to expansion” without breaking existing implementations


tl;dr (See title)

I have a feeling I’m perplexed over an issue long resolved as I don’t see a lot of questions related to this particular problem (IMO) where I was expecting to see a bajillion. Anyway, long story short, for example; I have an interface Requests which basically lists all the requests a client can make to a server program. Now an obvious problem arises where I have to add a new request to the program i.e. the interface. Existing implementing classes would then have to implement the newly added method in order to compile and that can’t be any good. How then can interfaces be made to comply with the Open-Closed Principle?

Breaking a monolith into microservices using templates for similar apps

I have a huge monolith application, a ASP.NET MVC Framework service offering ~50 different “groups” of unrelated data, separated into 50 different controllers/business logics. I was tasked into breaking this monolith into 50 microservices (each one hosted in Docker containers).

So far so good. What I’m planning to do is to create a “template application” using ASP.NET Core (an evolution of the ASP.NET Framework) to serve as a reference project and, for each of the 50 applications, I will fork this “template” project, add the corresponding controller with the necessary business logic and may need or not to customize this template to add some specific features.

For example, one application may need to respond to requests using a CSV format instead of the JSON, which is the standard for ~45 apps. So, I would modify the “template project” to include this “CSV response” feature and it would be used by the other ~4 projects that would use it.

What are the pros and cons of this approach using a “template” project?

What I can see currently:

PROS

  • Developing a ASP.NET Core application is easy, but it requires some configurations and customizations (CORS, Cache, routes, etc.) that would be already defined into “my company template” project.

CONS

  • Forking and merging the template project can be troublesome. If we find a security issue in the template, it would be necessary to manually update all of the 50 projects.

PS: I have already studied the pros and cons about migrating or not to Microservices. For this questions, I would prefer to focus on HOW to migrate to microservices and not WHY.

[ Renting & Real Estate ] Open Question : Ramifications of breaking a lease early due to heath concerns?

My lease just auto-renewed at the beginning of January, but while fixing a plumbing issue that required access to the apartment below me, they found high levels of black mold all over the downstairs apartment. (It’s an old house split into 4 apartments, and the old man who has the one below me hasn’t actually lived there in about 6 years. He said that he knew about the black mold before he moved out.) The property manager said that they’d not done the required annual inspection in several years, and she also said that the homeowner was going to have to file an insurance claim. My concern is that it could have spread to my apartment. Ever since I moved in over a year ago, I have wondered if there might be a mold problem because I’ve been getting sick way more often than I ever have before, but they assured me that my apartment had been redone just before I moved in because the previous tenants left it a wreck. The floor is still soft in some places though. I like my apartment and the location, but I’m really uncomfortable with the idea of staying somewhere that has such a bad issue. What is the likelihood of getting out of this lease without losing my security deposit and having to pay for the remaining months? Especially considering that they should have been conducting their annual inspections for all these years to avoid an issue like this.