什么是无状态课程? [英] what is a stateless class?

查看:47
本文介绍了什么是无状态课程?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道无状态类(如果有)的缺点是什么?有没有人看到一个现实世界的应用程序,其中某些用例被强制创建了无状态类(请不要打招呼).我认为无状态类意味着没有任何字段的类.

I would like to know what are drawbacks of a stateless class (if any)? Has anyone seen a real-world application where some use case mandated the creation of a stateless class (No hello world please )? I think a stateless class means a class without any fields.

推荐答案

我从未听过无状态类",但是我认为您的意思是不可变的对象(非常有用的概念!).或者也许是一个没有任何字段的类,所以通常看起来像是一堆纯函数.

I never heard "stateless class", but I think you mean immutable objects (very useful notion!). Or maybe a class which doesn't have any fields, so usually it looks like just bunch of pure functions.

这篇关于什么是无状态课程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆