logo

Crowdly

Browser

Add to Chrome

Основи розробки програмного забезпечення на платформі Microsoft.NET

Looking for Основи розробки програмного забезпечення на платформі Microsoft.NET test answers and solutions? Browse our comprehensive collection of verified answers for Основи розробки програмного забезпечення на платформі Microsoft.NET at do.ipo.kpi.ua.

Get instant access to accurate answers and detailed explanations for your course questions. Our community-driven platform helps students succeed!

public class ValidationProxy : ICommand

{

private readonly ICommand _real;

public ValidationProxy(ICommand c)=>_real=c;

public void Execute(Order o)

{

if(!o.IsValid()) throw new Exception("bad");

_real.Execute(o);

}

}

Що тут Proxy, а не Adapter?

0%
0%
0%
0%
View this question

  • Абстрактна фабрика (Abstract Factory).
  • Будівельник (Builder).
  • Фабричний метод (Factory Method).
  • Прототип (Prototype).
  • Одинак ​​(Singleton).

Перелічені патерни відносять до

0%
0%
100%
View this question

Агрегація

100%
0%
0%
0%
0%
View this question
Що виведе згенерований код?

List

x = new(){ 2,4,8,16,32 };

var agg = x.Skip(1).Aggregate((a,b)=>a/b);

]]>
100%
50%
50%
100%
View this question

public class DbLazyProxy : IDb

{

private IDb? _real; private readonly string _cs;

public DbLazyProxy(string cs)=>_cs=cs;

private IDb Real=>_real ??= new SqlDb(_cs);

public int Query(string q)=>Real.Query(q);

}

Головна вигода DbLazyProxy:

0%
100%
0%
0%
View this question

public class Sum : Expr

{

private readonly Expr _l, _r;

public Sum(Expr l, Expr r)=>(_l,_r)=(l,r);

public override int Eval(Context c) => _l.Eval(c) + _r.Eval(c);

}

Що демонструє клас Sum?

100%
0%
0%
0%
View this question
Що виведе згенерований код?

var repeat = Enumerable.Repeat("Hi",3).Select((s,i)=> $"{i}-{s}");
]]>
50%
100%
100%
50%
View this question

Реалізація

0%
0%
0%
0%
View this question
Що виведе згенерований код?

var dict = new Dictionary

{{1,"one"},{2,"two"},{3,"three"}}

.Where(kv => kv.Key%2==1);

]]>
0%
0%
0%
0%
View this question

ColorInfo ci = colorFlyweight.Get("#FF00FF");

Навіщо Flyweight у сервісі кольорів?

0%
0%
100%
0%
View this question

Want instant access to all verified answers on do.ipo.kpi.ua?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome