問題タブ [specification-pattern]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
design-patterns - 戦略の仕様パターンで最も明示的な仕様
複数の要因に基づいてアプリの動作を決定するビジネス ロジックがたくさんあるとします。また、動作を戦略パターンに置き換えることができる、非常に優れた場所がいくつかあります。また、問題を解決するためにさまざまなパターンを活用しようとしていると考えると、
- 戦略パターン
- 仕様パターン
- 工場パターン
工場で戦略を決定するために仕様パターンを使用し、Open Closed 原則を維持することは可能ですか?
私は工場を持っており、正しい戦略を選択するために、前のコードと同じように switch ステートメントを作成していることに気づきました。これは逆効果のようです。
これらすべての論理的な決定を仕様に押し付けたいのですが、仕様を順序付けするか、最も明確な仕様を最初に選択するかという問題が発生します。
これを解決する方法はありますか?
git - gitは特定のディレクトリを無視します
最近、dotnetnuke Web サイトを git にアップロードしたかったのですが、現在、私の Web サイトには、git でアップロードしたくない画像のギグがあります。
私はGITを検索していて、リポジトリの作成中に作成される.gitignoreファイルに出くわしました.GITにはファイル/フォルダーの無視に関するドキュメントがあり、それは特定のサブフォルダーですが、私の場合はうまくいかないようです.
私のフォルダ構造は次のとおりです。
*******更新しました*******ここで、Portals/_default 以外の Portals の下のすべてのフォルダーを無視したいと考えています。GITの仕様に基づいて試しました:
以下は私が試したものです:
しかし、これはまったく機能していないようです。
誰でも私を正しい方向に導くことができますか?
c# - c# Process Complex Rules
I have a situation where it is possible for a user to develop complex requirements using a UI. Specifically it deals with authorising users to perform certain work based on their qualifications.
For example the user must have;
- All of These: Qual1, Qual2, Qual3
- OR (One of These: (Qual4, Qual5) AND (All of These: Qual11, Qual12, Qual13))
- AND
- One or More of These: Qual6, Qual7, Qual8
- AND One of These: Qual9, Qual10
I've had a look at the Specification Pattern but I'm not sure if this is the best solution for the problem.
The requirements for each role are stored in the database using an Authorisation table linked to a Qualifications table and the user's training via a Training table linked to the Qualifications table.
automapper - 仕様パターンを使用しながら Automapper を使用してオブジェクトを構成する
以下の例に示すように、仕様パターンを使用してオブジェクトを構成できます。
これにより、データを DTO から仕様オブジェクトに手動でマップする必要があります。 仕様パターンを使用しながら、オートマッパーを使用してオブジェクトを埋める方法はありますか? Automapper は何らかの形でこれをサポートしていますか?
ありがとう
c#-4.0 - 仕様パターンの実装方法
私のプロジェクトでは; 以下に示す特定のパターンクラスを含めました。これを実装する方法がわかりません。これらのコードは、以前の開発者によって含まれています。
簡単な例で上記の仕様を実装する方法は? この仕様の用途は何ですか?