1つのクラス・モジュール・関数を変更する理由は1つ以上存在してはならない。
- いろいろなものをモックしないといけないのでテストしづらくなる
- 1つ修正したときに周辺確認がやたら多くなり工数が増える
use bytes::Buf; | |
pub trait BinaryRead: Sized { | |
fn read<T: bytes::Buf>(reader: &mut BinaryReader<T>) -> Option<Self>; | |
} | |
pub struct BinaryReader<T: bytes::Buf> { | |
pub buf: T, | |
} |
import { strict as assert } from 'assert'; | |
import { Operator, OperatorFunction, Subscriber } from "rxjs"; | |
export type FilterMap<T, U> = (e: T, index: number) => U | null; | |
class FilterMapSubscriber<T, U> extends Subscriber<T> { | |
private count = 0; | |
private readonly thisArg: any; | |
constructor( | |
destination: Subscriber<U>, |
import { EventEmitter, Injectable } from '@angular/core'; | |
import { Overlay, OverlayConfig } from '@angular/cdk/overlay'; | |
import { ComponentPortal, ComponentType } from '@angular/cdk/portal'; | |
import { Observable } from 'rxjs'; | |
import { tap } from 'rxjs/operators'; | |
export interface DialogNeed<Return> { | |
close$: EventEmitter<Return>; | |
} |
#include <functional> | |
#include <iostream> | |
#include <vector> | |
#include <map> | |
#include <initializer_list> | |
class JsonArchive { | |
public: | |
explicit JsonArchive(std::ostream &stream) |
#include <algorithm> | |
#include <iostream> | |
#include <vector> | |
#include <map> | |
#include <string> | |
#include <queue> | |
#include <stack> | |
#include <set> | |
#include <list> |
#pragma once | |
/** | |
* @brief コールバックストリームバッファ | |
* @note 出力をバッファリングし、書き込み用の関数をコールバックする | |
*/ | |
class CallbackStreamBuffer : public std::basic_streambuf<char> | |
{ | |
/** | |
* @brief 親クラス |
type updator<T> = (prev: T) => T; | |
class PartialUpdate<Props> | |
{ | |
private _props: Props; | |
protected get props(): Props { | |
return this._props; | |
} | |
constructor(props: Props | updator<Props>, prev?: Props) { |
class PartialUpdate<Props> | |
{ | |
constructor(protected props: Props) { | |
PartialUpdate.deepFreeze(this); | |
} | |
private static deepFreeze(o: any) { | |
Object.freeze(o); | |
var oIsFunction = typeof o === "function"; |
public class ProductMain { | |
public boolean executeMain(ResourceHolder resourceholder) { | |
Log log = BCLogFactory.getLog(ProductMain.class); | |
CommonPrinter commonPrinter = null; | |
Statement statement = null; | |
ResultSet resultSet = null; | |
try { | |
String outputileName = resourceHolder.getOutputFileName(); | |
commonPrinter = new CommonPrinter(outputFileName, "UTF-8"); | |
Connection connection = resourceHolder.getConnection(); |