Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memento ve Observer Tasarım Desenlerinde ToString() metodu Kullanımı #26

Closed
Natgho opened this issue Dec 22, 2021 · 1 comment
Closed

Comments

@Natgho
Copy link
Contributor

Natgho commented Dec 22, 2021

Memento ve Observer tasarım desenleri anlatılırken C# anlatımında ToString() metodu override edilmesine rağmen main içerisinde çağırılırken class ismi yerine ToString() metodu çağırılmaya devam edilmiş. Direkt olarak class'ın çağırılması da mümkün.
Örnek:

Memento:
// Yığındaki bir önceki duruma geçiyor. textOriginator.Undo(); Console.WriteLine(textOriginator.ToString());

Yerine:
// Yığındaki bir önceki duruma geçiyor. textOriginator.Undo(); Console.WriteLine(textOriginator);

@yusufyilmazfr
Copy link
Owner

Selam @Natgho, ilk bakışta evet direkt de kullanılabilirdi. Böyle de kalabilir, ToString metotu silinebilir de. Dilersen PR'da da bulunabilirsin. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants