RefactoringPresentation:Android重构

  • S2_490654
    了解作者
  • 112KB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • VIP专享
    资源类型
  • 0
    下载次数
  • 2022-05-10 17:41
    上传日期
重构演示 该存储库提供了专门针对android重构的提示和技巧。 我为我的android重构演示文稿之一准备了源代码。 它是通过应用重构规则来改善现有android代码的信息源。 这是此演示文稿代码的包结构:#Comments.java此类提供有关为代码编写更好的注释或Java文档的信息。 #exceptions我们知道,在Android中,NullPointerException非常常见。 该软件包提供了各种更好地管理异常的示例。 #myswitchcase有时我们会创建巨大的if-else曲线以检查条件逻辑。 因此,我们使用开关案例或if-else曲线,但我们可以将其替换为Factory Method设计模式。 您可以在ScreenFactory.java类中找到示例。 #Naming.java我们命名我们的类,方法,命名无处不在。 因此,我们应该遵循Android或Java开发的命
RefactoringPresentation-master.zip
内容介绍
# RefactoringPresentation This repository provides tips and tricks specially on android refactoring. I prepared the source code for one of my android refactoring presentation. It's a source of information to improve the existing android code by applying refactoring rules. Here is the package structure for this presentation code: #Comments.java This class provides information about to write better comment or Java documentation for your code. #exceptions We know that, in android NullPointerException is very common. This package provides various example of managing exceptions better way. #myswitchcase Sometimes we create huge if-else curve to check conditional logic. Thus, we use switch case or if-else curve but we can replace it with Factory Method design pattern. You can find the example in ScreenFactory.java class. #Naming.java We name our class, methods and naming is everywhere. So we should follow naming conventions for Android or Java development. This class provides all sorts of information to name your android code. #ClazzesActivity.java When we clicked on a button, we try to launch a new Activity. Here in this case we create lots of duplicate code but we can avoid it by creating a generic method. #TestDb.java How to test your code using android test frameword before releasing your actual code. If you want to apply this techniques in your code, please do a pull. Or if you have any confusion or any suggetion, please let me know.
评论
    相关推荐